0

I have an oracle function which returns an array of integers for which a type has been written at database. Code is as follows :

create or replace type my_ids is table of number;

By looking at the examples present online I am trying to call that function but it is always saying

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

Here is code snippet which I tried:

@Entity
@Table(name = "My_Table")
@NamedStoredFunctionQuery(name = "get_ids", functionName = "my_function", 
parameters = 
{
@StoredProcedureParameter(name = "batch_size", queryParameter = "batch_size", type = Long.class)
},
returnParameter = @StoredProcedureParameter(mode = ParameterMode.OUT , name= "my_ids" , queryParameter = "my_ids" , jdbcType = OracleTypes.ARRAY))
public class MyEntity implements Serializable {

//Fields
// 

}

By analyzing the error I am getting, I know there is some problem with defining returnParameter but I am not sure what exactly I am missing. Please help me with the code. Thanks

rishi
  • 1,792
  • 5
  • 31
  • 63
  • Possible duplicate of [How to call function using EclipseLink](https://stackoverflow.com/questions/27961486/how-to-call-function-using-eclipselink) – Juan Carlos Mendoza Aug 29 '17 at 21:45
  • 2 things to consider before saying it duplicate. I saw that question already. It uses ref_cursor which I don't. It does not have an answer also. – rishi Aug 29 '17 at 21:49
  • Its not an array but a table, a PL/SQL construct that isn't supported directly through JDBC which JPA uses underneath. see https://www.eclipse.org/eclipselink/documentation/2.5/solutions/oracledb002.htm#CHDDCIEC – Chris Aug 30 '17 at 14:31

0 Answers0