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.  [ 1 post ] 
Author Message
 Post subject: polymorphic one-to-many bidirectional mappings
PostPosted: Mon Dec 13, 2004 5:20 pm 
Newbie

Joined: Mon Dec 13, 2004 3:47 pm
Posts: 3
Location: London
Hibernate version:
2.1.2


I have a class with several inverse relationships (one-to-many).

<set
lazy="true"
inverse="true"
update="true"
insert="true">
<key column="someColumn"/>
<one-to-many class="org.example.Relationship"/>

[Entity] 1 ----> n [org.example.Relationship]

It seems that I cannot have additional inverse relationships for the same column, even if they're mapped with insert=false, update=false and use a subtype of the class used to map the example above:

<set
lazy="true"
inverse="true"
update="false"
insert="false">
<key column="someColumn"/>
<one-to-many class="org.example.SpecialRelationship"/>

[Entity] 1 ----> n [org.example.SpecialRelationship]

in this case I only want to fetch objects of type "SpecialRelationship".

The generated selected ignores the type information and fetches objects of all classes , resulting in WrongClassExceptions.

is this kind of mapping possible in hibernate 2 ??


thanks,

Jan


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

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.