Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Hibernate Interview Questions and Answers

Ques. How do you map Java Objects with Database tables?
Ans. * First we need to write Java domain objects (beans with setter and getter). The variables should be same as database columns.

* Write hbm.xml, where we map java class to table and database columns to Java class variables.



Example :

<hibernate-mapping>

<class name="com.test.User" table="user">

<property column="USER_NAME" length="255″
name="userName"; not-null="true" type="java.lang.String"/>

<property column="USER_PASSWORD" length="255″
name="userPassword" not-null="true" type="java.lang.String"/>

</class>

</hibernate-mapping>
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook