ContactUs

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

How properties of a class are mapped to the columns of a database table in Hibernate?

Mappings between class properties and table columns are specified in XML file as in the below example:

 

<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC

 

"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

 

<hibernate-mapping>

 

<class name="departmentClass" table="TBL_DEPT">

 

<property name="dept" column="department_name">

 

<property name="Description" column="department_details"/>

 

<many-to-one name="nxtPer" cascade="all" column="NxtPerId"/>

 

</class>

 

</hibernate-mapping>

Related Posts Plugin for WordPress, Blogger...
Flag Counter