Is there any way in Hibernate 2.1.2 to map a one-to-many relationship (Provider-to-Service) in a such way, that I can retrieve a Collection (Set, List, whatever) with SQL like...
SELECT provider.services FROM Provider provider WHERE provider.providerid= :providerid
... if Service table has neither id column, no a single primary key column,
but has instead a uniquie index on four columns?
All the follwing mappings throw different exceptions. Do I HAVE TO HAVE a separate class for a key?
Bag mapping throws
"QueryException: unindexed collection before []: provider0_.services"
List, Set, Map mapping throws "Gatewaynet.sf.hibernate.MappingException: collection index mapping has wrong number of columns" while the number of column is correct.
Another Map mapping throws "net.sf.hibernate.QueryException: composite-index appears in []: provider0_.services"..... :)
|