Following the examples on EclipseLink JPA Extensions website I'd be able to call procedures with simple types as arguments. But I wasn't able to annotate my entity classes so that they would map correctly to the PL/SQL Object types in the database when the objects are a bit more complex.
For example we have a stored procedure that has one input and one output parameter of the same Object type A. The type structure is following:
Object type A contains <- Table type B which is table of <- Object type C which contains <- Table type D which is table of <- Object type E.
I figured I shall use the @OracleObject for the Object types and @PLSQLTable for the Table types but I haven't found a way how to correctly combine them together.
I've tried the following:
// All annotations with the required elements
@Embeddable
@Struct
@OracleObject
public class A {
@Column(name = "B")
private B b;
// Getter and setter
}
@Embeddable
@Struct
@PLSQLTable (.., nestedType = "C")
public class B { }
@Embeddable
@Struct
@OracleObject
public class C {}
I've tried to add the @PLSQLTable with the proper annotation elements to class A and/or to class C but the Java and DB objects do not map to each other correctly and I'm getting the java.sql.SQLException: Invalid column type
during the call.
I'd greatly appreciate if someone could explain to me how to use the annotations to tell the EclipseLink that Object A contains Table B of Object C.
Thank you very much.