Joined: Wed Aug 01, 2007 6:08 pm Posts: 13
|
I am using Hibernate 3.2 with annotations and JPA. I am converting some old hibernate mapping files to use annotations. In one case we are using assocations based on join tables, but I wasn't sure what would be right syntax with the annotations especially with composite types.
Here is how the mapping looks like:
<list name="scenarios" table="saved_view_scenario">
<key column="saved_view_id" />
<index column="element_order" />
<composite-element class="amazon.otb.common.view.SavedViewScenario">
<parent name="savedView" />
<many-to-one name="scenario" column="scenario_id" class="amazon.otb.common.Scenario" />
<property name="modifications" not-null="true"/>
</composite-element>
</list>
<list name="dataElements" table="saved_view_data_element">
<key column="saved_view_id" />
<index column="element_order" />
<many-to-many column="data_element_id" class="amazon.otb.common.DataElement" />
</list>
I would appreciate if someone can suggest corresponding syntax with JPA compliant annotations.
|
|