SchTestTeam.hbm.xml
<hibernate-mapping>
<class name="com.ccc.test.SchTestTeam" table="SCH_TEST_TEAM" schema="WTADMIN" lazy="false">
<id name="teamId" column="TEAM_ID">
<generator class="increment" />
</id>
<property name="teamName" column="TEAM_NAME"> </property>
<property name="branchId" column="BRANCH_ID"> </property>
<list name="schTests" table="SCH_TEST" cascade="all" inverse="false">
<key column="TEAM_ID" />
<index column="'TEAM_ID'" />
<one-to-many class="com.ccc.test.SchTest" />
</list>
</class>
</hibernate-mapping>
SchTest.hbm.xml
<?xml version="1.0" ?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.ccc.test.SchTest" table="SCH_TEST" schema="WTADMIN">
<id name="id" column="ID"><generator class="increment" /></id>
<property name="empNo" type="java.lang.String" column="EMP_NO" />
<property name="empName" type="java.lang.String" column="EMP_NAME" />
<property name="age" type="java.lang.Long" column="AGE" />
<property name="sex" type="java.lang.String" column="SEX" />
<many-to-one name="schTeam" column="TEAM_ID" class="com.ccc.test.SchTestTeam" fetch="join" />
</class>
</hibernate-mapping>