Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Hibernate Interview Questions and Answers

Test your skills through the online practice test: Hibernate Quiz Online Practice Test

Related differences

Ques 31. How do you invoke Stored Procedures?

<sql-query name="selectAllEmployees_SP" callable="true">
<return alias="emp" class="employee">
<return-property name="empid" column="EMP_ID"/>
<return-property name="name" column="EMP_NAME"/>
<return-property name="address" column="EMP_ADDRESS"/> { ? = call selectAllEmployees() }

Is it helpful? Add Comment View Comments

Ques 32. Explain Criteria API?

Criteria is a simplified API for retrieving entities by composing Criterion objects. This is a very convenient approach for functionality like "search" screens where there is a variable number of conditions to be placed upon the result set.
Example :
List employees = session.createCriteria(Employee.class) .add("name", "a%") ) .add("address", "Boston")) .addOrder(Order.asc("name") ) .list();

Is it helpful? Add Comment View Comments

Ques 33. Define HibernateTemplate?

org.springframework.orm.hibernate.HibernateTemplate is a helper class which provides different methods for querying/retrieving data from the database. It also converts checked HibernateExceptions into unchecked DataAccessExceptions.

Is it helpful? Add Comment View Comments

Ques 34. What are the benefits does HibernateTemplate provide?

The benefits of HibernateTemplate are :
* HibernateTemplate, a Spring Template class simplifies interactions with Hibernate Session.
* Common functions are simplified to single method calls.
* Sessions are automatically closed.
* Exceptions are automatically caught and converted to runtime exceptions.

Is it helpful? Add Comment View Comments

Ques 35. How do you switch between relational databases without code changes?

Using Hibernate SQL Dialects, we can switch databases. Hibernate will generate appropriate hql queries based on the dialect defined.

Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2024 WithoutBook
Hibernate 3 vs Hibernate 4JDBC vs HibernateJPA vs Hibernate