jaydeep.roy wrote:
can anyone help me here, i would really appreciate it.
I want to use hibernate List instead of a Set for my scenario
Try understanding below code.maybe it will help you
<class name="NAME_OF_PARENT_CLASS" table="PARENT_TABLE_NAME">
<id name="PARENT_ID">
<generator class="sequence">
<param name="sequence">NAME_OF_SEQUENCE_OF_PARENT_TABLE</param>
</generator>
</id>
<bag name="NAME_OF_LIST_USED_IN_PARENT_CLASS" cascade="all" >
<key column="NAME_OF_JOIN_ID"/> // Note: ID on which you are joining two tables
<one-to-many class="NAME_OF_CHILD_CLASS"/>
</bag>
<property name="xyz" column="xyz" type="java.lang.String"/>
All properties of parent tables will go here
</class>
<class name="NAME_OF_CHILD_CLASS" table="CHILD_TABLE_NAME">
<id name="CHILD_ID">
<generator class="sequence">
<param name="sequence">NAME_OF_SEQUENCE_OF_CHILD_TABLE</param>
</generator>
</id>
<property name="xyz" column="xyz" type="java.lang.String"/>
All properties of child tables will go here
</class>