ContactUs

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

How mapping of java objects is done with database tables?

To map java objects with database tables, we need to have Java beans properties names same as column names of a database table. Then mapping is provided in hbm.xml file as given below:

<hibernate-mapping>

<class name="Student"  table="tbl_student">

<property  column="studentname" length="255"

name="studentName" not-null="true"  type="java.lang.String"/>

<property  column="studentDisciplne" length="255"

name="studentDiscipline" not-null="true"  type="java.lang.String"/>

 </class>

</hibernate-mapping>

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