We're updating the issue view to help you get more done. 

Implement REF_CURSOR support for StoredProcedureQuery

Description

1 2 3 4 5 6 7 8 9 10 11 12 13 14 Session session = em.unwrap(Session.class); org.hibernate.procedure.ProcedureCall call = session.createStoredProcedureCall("FIND_ITEMS"); call.registerParameter(1, Object.class, ParameterMode.REF_CURSOR); org.hibernate.result.ResultSetOutput resultSetOutput = (org.hibernate.result.ResultSetOutput) call.getResult().getCurrent(); List<Item> result = resultSetOutput.getResultList(); assertEquals(result.size(), 3); for (Item item : result) { // ... }
1 2 3 4 5 6 create function FIND_ITEMS() returns refcursor as ' declare someCursor refcursor; begin open someCursor for select * from ITEM; return someCursor; end;' language plpgsql;
1 2 3 4 org.hibernate.cfg.NotYetImplementedException: Support for REF_CURSOR parameters not yet supported at org.hibernate.procedure.internal.AbstractParameterRegistrationImpl.prepare(AbstractParameterRegistrationImpl.java:220) at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:421) at org.hibernate.procedure.internal.ProcedureCallImpl.getResult(ProcedureCallImpl.java:375)

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Christian Bauer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Minor