That sounds pretty straight forward. If you want a
one way one-to-many relationship between 2 different objects (such as an order and order details) the most common approach is using the
<many-to-many> tag with
unique="true", inside a
collection tag. For the collection you can use most collection types including maps, lists or sets. You use a
<many-to-many> because this creates a seperate joining table between the two seperate class tables. The
<one-to-many> tag only defines a link that uses foreign keys, which is an uncommon approach but possible.
Code:
eg
<list name="orderDetails"> // the name of the property
<key column="orderId"/> // just a column name - not critical
<many-to-many class="OrderDetails" unique="true"/>
</list>
The general idea is summarised at the unidirectional one-to-many entry at:
http://www.hibernate.org/hib_docs/v3/re ... l-join-12m
There is one example of a similar case to yours in the hibernate docs at:
http://www.hibernate.org/hib_docs/v3/re ... derproduct
happy hibernating
Michael