You can really use objects from the Oracle JDBC driver, as suggested by Philip. Most users complete the creation of utility methods for transferring this logic. Or they use Spring mapping classes. However, there is a lot of manual work.
Another approach is to use the upcoming version 1.5.4 of jOOQ - the open source library that I am developing - where arrays are supported evenly. Therefore, when you have your types:
type MyDoubles as varray(50000) of double precision type MyStrings as varray(50000) of varchar2(2000)
Then jOOQ will generate classes like
public class MyDoubles extends ArrayRecordImpl<Double> { } public class MyStrings extends ArrayRecordImpl<String> { }
Your stored procedures might look like this:
PROCEDURE MY_PROC1 (d IN MyDoubles, s IN MyStrings); PROCEDURE MY_PROC2 (d IN MyDoubles, s OUT MyStrings); PROCEDURE MY_PROC3 (d OUT MyDoubles, s OUT MyStrings);
And jOOQ will create another Java class like
public class Procedures {
Generated code artifacts that invoke stored procedures with UDT, VARRAY parameters are as simple as possible. When generating the source code, you can change objects (for example, your types or your procedures) in your database schema, and your Java classes immediately reflect this change.
Read more at http://www.jooq.org/manual/META/PROCEDURE/
source share