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. What do you mean by Named - SQL query?
Ans. Named SQL queries are defined in the mapping xml document and called wherever required.
Example:
<sql-query name = \"empdetails\">
<return alias=\"emp\" class=\"com.test.Employee\"/>
SELECT emp.EMP_ID AS {emp.empid}, emp.EMP_ADDRESS AS {emp.address}, emp.EMP_NAME AS {emp.name} FROM Employee EMP WHERE emp.NAME LIKE :name
</sql-query>

Invoke Named Query :
List people = session.getNamedQuery(\"empdetails\") .setString(\"TomBrady\", name) .setMaxResults(50) .list();
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook