Dear all:
These days I tried to develope struts and hibernate3 application in Myeclipse4.1.1.I used the wizard to add the hibernate capabilities to the JavaProject and used the Create Hibernate Mapping Item of the DB Brower’s PopupMenu.But I found something special.It generated three java file and one hbm.xml file.The three java file name are: AbstractAssessGrade.java, AssessGrade.java and AssessGradeId.java.The hbm.xml file generated like the following:
<hibernate-mapping>
<class name=”com.test.grade.AssessGrade” table=”AssessGrade” schema=”dbo” catalog=”kpi_tg”>
<composite-id name=”id” class=”com.test.grade.AssessGradeId”>
<key-property name=”gradeId” type=”string”>
<column name=”gradeId” length=”32″ />
</key-property>
<key-property name=”gradeName” type=”string”>
<column name=”gradeName” length=”50″ />
</key-property>
<key-property name=”maxGrade” type=”double”>
<column name=”maxGrade” precision=”18″ scale=”3″ />
</key-property>
<key-property name=”minGrade” type=”double”>
<column name=”minGrade” precision=”18″ scale=”3″ />
</key-property>
<key-property name=”limitCount” type=”integer”>
<column name=”limitCount” />
</key-property>
<key-property name=”createTime” type=”timestamp”>
<column name=”createTime” length=”23″ />
</key-property>
</composite-id>
</class>
</hibernate-mapping>
❓ What’s the “composite-id” element and the AssessGradeId.java?
This hbm.xml file’s structure is not like those examples in the Hibernate3.1.2.zip.
❓ Can anyone tell me how the three java file work?
In the Hibernate3.1.2.zip’s examples there are onle one POJO and hbm.xml file .