// create an artist with painting in the database
createArtist(1000.0);
// test ProcedureQuery with Procedure as root
Procedure proc = ctxt.getEntityResolver().getProcedure(SELECT_STORED_PROCEDURE);
ProcedureQuery q = new ProcedureQuery(proc);
q.setFetchingDataRows(true);
q.addParameter("aName", "An Artist");
q.addParameter("paintingPrice", new Integer(3000));
// TESTING THIS ***
// A.ARTIST_ID, A.DATE_OF_BIRTH, A.ARTIST_NAME
ColumnDescriptor[] columns = new ColumnDescriptor[3];
// read ID as Long, and everything else as default types
columns[0] = new ColumnDescriptor("ARTIST_ID", Types.BIGINT, Long.class
.getName());
columns[1] = new ColumnDescriptor("ARTIST_NAME", Types.CHAR, String.class
.getName());
columns[2] = new ColumnDescriptor("DATE_OF_BIRTH", Types.DATE, Date.class
.getName());
q.addResultDescriptor(columns);
List rows = runProcedureSelect(q);
// check the results
assertNotNull("Null result from StoredProcedure.", rows);