if (value instanceof ArrayList) {
// JPA query results in a list of raw values
// Here we have raw values returned as opposed to DatabaseRecords - this means
// we need to figure out the tag names based on the call's output parameters.
// assumes JPAQuery
JPAQuery jpaQuery = (JPAQuery) queryHandler.getDatabaseQuery();
// to match field names with results, we need to gather the database fields from each of the Output parameters
List<DatabaseField> paramFlds = new ArrayList<DatabaseField>();
DatasourceCall dsCall = (DatasourceCall) jpaQuery.getDatabaseQuery().getDatasourceCall();
for (Object obj : dsCall.getParameters()) {
if (obj instanceof OutputParameterForCallableStatement) {
paramFlds.add(((OutputParameterForCallableStatement) obj).getOutputField());
} else if (obj instanceof Object[]) {
Object[] objArray = (Object[]) obj;