Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Hibernate Interview Questions and Answers

Ques 31. How do you invoke Stored Procedures?

Ans. <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?
Ans. 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(Restrictions.like("name", "a%") ) .add(Restrictions.like("address", "Boston")) .addOrder(Order.asc("name") ) .list();
Is it helpful? Add Comment View Comments
Ques 33. Define HibernateTemplate?
Ans. 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?
Ans. 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?
Ans. 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:

©2016 WithoutBook