Beginner |
|
Joined: Wed Sep 10, 2003 5:34 pm Posts: 36 Location: New York, NY
|
Sure Gavin. In this case the parent/child is a self join that looks like this:
<property name="order" column="CNT_CHILD_ORDER" type="int"/>
<many-to-one name="parent" column="CNT_PARENT_CONTENT_ID" class="blah.blah.Content"/>
<list name="children" lazy="true">
<key column="CNT_PARENT_CONTENT_ID"/>
<index column="CNT_CHILD_ORDER"/>
<one-to-many class="blah.blah.Content"/>
</list>
I originally had the list set as inverse and was just setting the parent, but this resulted in incorrect ordering (or no ordering at all). So my question is, for the ordering index column to be set properly by hibernate do I need to explicitly add the Content object to the list of children, or is simply setting the parent enough and hibernate will figure it out?
I appreciate the help.
Matt
|
|