Regular |
 |
Joined: Tue Jul 13, 2004 2:27 am Posts: 73 Location: Singapore
|
Here is the mapping file - A has one-to-many association with B:
A
===
<hibernate-mapping>
<class name="A" table="A">
<id name="aId" type="long" column="A_ID" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="aName" type="string" not-null="true" column="NAME"/>
<set name="bs" table="A_B" cascade="save-update" inverse="false" lazy="true">
<key column="A_ID"/>
<one-to-many class="B"/>
</set>
</class>
</hibernate-mapping>
B
===
<hibernate-mapping>
<class name="B" table="B">
<id name="bId" type="long" column="B_ID" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="bName" type="string" not-null="true" column="NAME"/>
<property name="sequence" type="integer" column="SEQUENCE"/>
</class>
</hibernate-mapping>
So what I would like is to have the 'order-by' in class A, sort the bs according to the column SEQUENCE in class b.
is it possible ?
thanks
li xin
|
|