-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: one-to-many relationship mapping that works?
PostPosted: Fri Mar 05, 2004 12:21 pm 
Newbie

Joined: Fri Mar 05, 2004 11:54 am
Posts: 1
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"..... :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 11:21 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Read the Header before posting, it's in red.
mapping etc is mandatory to help you.

You've probably misset your composite-id and the <many-to-one> may refer to an different structure than the composite-id one

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.