Announcement Announcement Module
Collapse
No announcement yet.
composite-element with a join Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • composite-element with a join

    I want to map a collection as a collection of composite-elements because the children lifecycle's are completely dependent on the parent. However the children have what is in effect a one-to-one relationship with another table via a join table. I was wondering if there is a way to do something like

    Code:
    <!-- Unidirectional one-to-one on join table  -->        
            <join table="BNRY_xxxxE_TMPLT" optional="true">
            	<key column="xxxxxxTMPLT_ID" unique="true"/>
            	<many-to-one name="link"
                			 not-null="true"
                			 unique="true">
                	<column name="xxxxT_ID" not-null="true" />
    		<column name="xxxx_NB"  not-null="true"/>
                </many-to-one>
            </join>
    within a composite-element. I can't find anything in the documentation or examples.

    The above mapping works fine when I map the children as their own entities.

    The downside of the "children as entity" approach is that when the parent is updated, I want to recreate (so delete and then reinsert the collection) the children, not have to merge the children in. Which I can do, but mapping the children as components hibernate does it for me....

    thanx
Working...
X