-->
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: Does <parent> work with composite-element in maps/sets
PostPosted: Wed Dec 21, 2005 12:32 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I'm hoping to get a reference to the containing class from all objects in a map. Here's a partial mapping file:

Code:
<class name="Container" ...>
    ...
    <map name="Items" ...>
      <key column="ContainerID"/>
      <map-key column="ItemID" type="integer"/>
      <composite-element class="Item">
        <parent name="Container"/>
        <property name="ItemID" formula="ItemID" insert="false" update="false"/>
        ...
      </composite-element>
    </map>
    ...
</class>


But hibernate always passes null to Item.setContainer(). I'm assuming that it has something to do with being in a <map>, rather than being directly in the Container class. Is this the case? Is there a workaroud?

And while I'm here.. is the way I've included ItemID in the above example the best way to put the key for a particular value into that value?


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.