Hi All,
I'm connecting to an Oracle database, and accessing a function that returns a SYS_REFCURSOR. I can succesfully map the function using the following syntax:
@NamedNativeQuery( name = "blah_list" , query = "{ call blah__function(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}" , resultClass = blah.class , hints = { @QueryHint(name = "org.hibernate.callable", value = "true") , @QueryHint(name = "org.hibernate.readOnly", value = "true") } )
I can access the resultset it returns.
The issue is, within the resultset, there are nested CURSOR expressions.. ie:
SELECT my_column1, my_column2 ,CURSOR ( SELECT my_column1 FROM my_table2 WHERE blah = blah ) column3 FROM my_table1
My question is, how do I return the data from all the cursors? I can return the main cursor (ie column 1 and 2), but column through comes through as empty.
Currently I'm using the following to access the resultSet:
public List<StandardServiceView> findstandardServiceView(Integer serviceID) { Query query = getEntityManager().createNamedQuery("blah_list"); query.setParameter(1, blahID); return query.getResultList(); }
|