After creating a project, right click on it and select New - other - Hibernate - Hibernate Mapping File as shown in the image below.
Selecting the Hibernate Mapping File type shows a brief description about it in the Description panel.
After selecting Hibernate Mapping File, press next button to bring up another wizard as shown below.
This wizard contains
Now press Next Button to select a mapping class..
This wizard contains
After pressing the Finish button, a mapping file is created and placed under src/java.
The contents of the newly created mapping file look as shown below:
<hibernate-mapping>
<class dynamic-insert="false" dynamic-update="false" mutable="true" name="personClass"
optimistic-lock="version" polymorphism="implicit" select-before-update="false"
table="PERSON"/>
</hibernate-mapping>
The mapping element in the configuration file is as shown below:
<hibernate-configuration>
<session-factory name="session1">
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="hibernate.connection.url">jdbc:derby://localhost:1527/travel</property>
<property name="hibernate.connection.username">travel</property>
<property name="hibernate.connection.password">travel</property>
<mapping resource="hibernate.hbm.xml"/>
</session-factory>
</hibernate-configuration>
| Image1.JPG | ![]() |
46285 bytes |
| Image2.JPG | ![]() |
37601 bytes |
| Image3.JPG | ![]() |
31935 bytes |