-->
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: Mapping assocation based on join tables into annotations
PostPosted: Wed Aug 08, 2007 8:58 pm 
Newbie

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.


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.