jasmine wrote:
HI,
I have written a query in my hibernate mapping document.Here is the snippet:
<query name="insert">
from Hibernate_test_insert where employeeid = ?
</query>
But when i call from my code as :
Query q = HibernateUtil.getSessionFactory().getCurrentSession().getNamedQuery("insert");
q.setString("employeeid",id);
Hibernate_test_insert obj = (Hibernate_test_insert) q.uniqueResult();
It throws an exception that :
org.hibernate.MappingException: Named query not known: insert
Any Ideas guys?
Regards,
Jasmine.