Hi
I would like to map an unidirectional one to many association with hibernate.
I found in the 18.3 Reference Chapter The Order to LineItem association which is what i m looking for.
Here is what i have Postcard contains a list of PostcardStatus:
Code:
<class name="PostcardHibernateAdapter" table="Postcard">
<id name="databaseId" column="id" type="long" unsaved-value="null">
<generator class="native"/>
</id>
<property name="originalText" column="originalText" type="text"/>
<list name="postcardStatus" table="PostcardStatus">
<key column="postcardId"/>
<index column="status_number"/>
<composite-element class="PostcardStatus">
<property name="value" column="value" type="int" not-null="true"/>
<property name="date" column="date" type="date" not-null="true"/>
<property name="reason" column="reason" type="string" not-null="true"/>
</composite-element>
</list>
</class>
With this mapping, the status are not saved. What am i doing wrong ?
Any example of one to many unidirectional association will be greatly appreciated.