0

I'm using JPA-2.1 and want a stored procedure and with a Collection as a parameter. Is this possible?

<named-stored-procedure-query name="myProc"
        procedure-name="my_proc">
    <parameter name="i_collection" class="Collection" mode="IN">
    </parameter>
</named-stored-procedure-query>

With the above I get a java.lang.ClassNotFoundException.

If not, where is the documentation about what is allowed in the class attribute?

Roland
  • 7,525
  • 13
  • 61
  • 124
  • 1
    so when you put "java.util.Collection" for class (because there is no class Collection in the default package), what happens? and when posting an exception, the stack trace may be of some use – Neil Stockton Feb 04 '15 at 11:24
  • I did as you suggested and it fixed the exception, but now I get a new one: Internal Exception: java.sql.SQLException: Invalid column type – Roland Feb 04 '15 at 13:38
  • which in turn would imply that some SQL has been executed, so what SQL, and maybe from that you can see some error relating to a column usage – Neil Stockton Feb 04 '15 at 13:55
  • The stored procedure only concatenates the elements in the collection into one varchar2. I guess the wrong column is referring to the type of the procedure argument which is an ORACLE VARRAY. – Roland Feb 04 '15 at 14:40

1 Answers1

0

I managed to do it using EclipseLink specific org.eclipse.persistence.queries.StoredProcedureCall

See also: http://wiki.eclipse.org/EclipseLink/Examples/JPA/StoredProcedures#PLSQLStoredProcedureCall_-_Complex_data

Roland
  • 7,525
  • 13
  • 61
  • 124