Manual
Figure 17-13 New XML File: Create XML Dialog Box
4. Select Create XML from an XML template and click Finish.
The Employee.hbm.xml file is created in the EmployeeInfo/src directory.
NOTE: By default, XML files open in the XML Editor. The XML Editor has two views:
Design and Source view. Select the Source view.
5. Modify the Employee.hbm.xml file by adding a Hibernate mapping for the
Employee.java class.
After modification, the Employee.hbm.xml file appears as follows:
<?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
package="com.hp.domain">
<class name="Employee" table="Emp" >
<id name="id">
<generator class="increment"/>
</id>
<property name="fname"
not-null="true"
length="15"
column="fname"/>
<property name="lname"
not-null="true"
length="15"
column="lname"/>
<property name="age" column="age" />
344 Getting Started with Hibernate