-->
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: Where can I find documentation on composite-element
PostPosted: Wed Aug 10, 2005 9:57 am 
Newbie

Joined: Mon Aug 08, 2005 11:09 am
Posts: 4
Hello All,

In reading through the docs and forum, I have seen reference to the composite-element mapping as an alternate way to define a parent/child relationship. However, I cannot find documentation on how to use it. Would someone please point me in the right direction.

For the curious, here is what I would like to accomplish:

I have a parent/child (one-to-many defining) relationship between two classes. The child is a lifecycle class and so has no existence beyond its parent. In the database, the child table's PK is comprised of a ChildID (synthetic integer) and an FK to the ParentID (also a synthetic integer).

From what I have read, I need a mapping like this in my Parent:
Code:
<bag name="Address" table="address" cascade="all-delete-orphan" lazy="false">
     <key column="PersonID" />
     <composite-element class="nHibTest.Address, nHibTest">
          <property name="Street" column="street" type="String" />
          <!-- rest of the properties -->
     </composite-element>
</bag>

However, <id> is not a valid child of <composite-element> so I do not know how to map that column.

Any help would be appreciated.

Thank you for your time,
Jay


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.