Abhilash wrote:
You may also express queries in the native SQL dialect of your database.
Native SQLs are your queries that you write in your database.
Native SQL queries may be defined in the mapping document and called in exactly the same way as a named HQL query.
example:
<sql-query name="mySqlQuery">
<return alias="person" class="eg.Person"/>
SELECT person.NAME AS {person.name},
person.AGE AS {person.age},
person.SEX AS {person.sex}
FROM PERSON person WHERE person.NAME LIKE 'Hiber%'
</sql-query>
List people = sess.getNamedQuery("mySqlQuery")
.setMaxResults(50)
.list();
ok,i see you method but how can i use the method instance my
sql query ????can you tell me and thank you