Hibernate version: 3.2
Mapping documents: Athlete, TrainProgram, Exercise
My problem is that I have to map classes that have Lists inside of them and I don't know how to do it.
For example:
Code:
ClassA{ List classB }
ClassB{ List classC }
ClassC{ *not anymore* }
ClassA.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="entities.ClassA table="CLASSA">
<id name="id" column="CLASSA_ID" type="long">
<generator class="increment"/>
</id>
<property name="name" column="CLASSA_NAME" type="string"/>
<property name="age" column="AGE" type="integer"/>
<property name="gender" column="GENDER" type="string"/>
<list name="classB" table="CLASSB">
<key column="CLASSB_ID" />
<list-index column="POSITION" />
<!-- Second List inside of the ClassB Class -->
<!--<list name="classC" table="CLASSC">
<key column="CLASSC_ID" />
<list-index column="POSITION" />
<one-to-many class="entities.CLASSC" />
</list>
-->
<!-- Second List inside of the ClassB Class -->
</list>
</class>
</hibernate-mapping>
Is that correct ? Or i just need to make the first hbm until the first class ?
Dunno also if i need to put the <element> component...
Can someone help me ?
Thanks