Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-8445

Implement REF_CURSOR support for StoredProcedureQuery

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0.Beta5
    • Component/s: None
    • Labels:
      None
    • Last commented by a user?:
      true

      Description

      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) {
          // ...
      }
      
      create function FIND_ITEMS() returns refcursor as '
          declare someCursor refcursor;
          begin
              open someCursor for select * from ITEM;
              return someCursor;
          end;' language plpgsql;
      
      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)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 10.75h
                  10.75h