Please send your Questions & Answers or Feedback to ""

What do you mean by Named – SQL query?

Named SQL queries are defined in the mapping xml document and called wherever required.
<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 {}
      FROM Employee EMP WHERE emp.NAME LIKE :name

Invoke Named Query :
List people = session.getNamedQuery("empdetails")
    .setString("TomBrady", name)

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