java - How to call in JPA a stored procedure which takes 'TABLE OF NUMBER' as a parameter -


oracle sql:

create or replace type some_array table of number;  create or replace procedure custom_procedure(array_param in some_array) (...) 

i'm using org.eclipse.persistence 2.x implementation of jpa theoretically should support such operation.

code:

//(... retrieve entitymanager instance => em ...) storedprocedurequery storedprocedure = entitymanager.createstoredprocedurequery("custom_procedure"); storedprocedure.registerstoredprocedureparameter("array_param", long[].class, parametermode.in); storedprocedure.setparameter("array_param", new long[] { 2l }); storedprocedure.executeupdate(); 

for above get:

internal exception: java.sql.sqlexception: invalid column type error code: 17004 


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -