Wednesday, 15 January 2014

java - How to get Hibernate entityManager.createNamedQuery results -



java - How to get Hibernate entityManager.createNamedQuery results -

i using hibernate 4.0

i have method in dao class next method homecoming entity class employees. calling oracle function returns sys_refcursor. how can homecoming entitymanager.createnamedquery in below method?

any help highly appreciated.

@override public employees getemployeerecords(string employeenumber) { <??> = entitymanager.createnamedquery("myfunction"); homecoming <??>; }

see this

query query = em.createquery("select e employee e e.name = :name "); query.setparameter("name", name); list<employee> results = query.getresultlist(); homecoming results;

here returning list of employee type , if want send 1 object this

return results.get(0);

regards

anshul

java hibernate jpa jpa-2.0

No comments:

Post a Comment