private Collection<Object> readNonEntityObjects(SObject[] sObjects, Expression[] exprs, Class resultClass) throws ConnectionException, SQLException { // Create metadata first. // Assume the data comes back in the same order as the expressions and use first item to get the metadata List<String> fieldNameList = new ArrayList<String>(); List<Expression> fieldNameExprs = new ArrayList<Expression>(); boolean createFieldNameExpressions = resultClass != null; getFieldNameList(sObjects, createFieldNameExpressions, fieldNameList, fieldNameExprs); // Now read the data based on the metadata if (createFieldNameExpressions) { if (exprs != null && exprs.length > 0) { return readCreatorExpressionObjects(resultClass, sObjects, exprs, fieldNameList); } else { return new JDOQLResultClassMapper(resultClass).map(getResultAsCollection(sObjects, fieldNameList), fieldNameExprs.toArray(new Expression[fieldNameExprs.size()])); } } else if (exprs != null && exprs.length > 0) { if (exprs[0] instanceof CreatorExpression) { CreatorExpression ce = (CreatorExpression) exprs[0]; return readCreatorExpressionObjects(ce.getSymbol().getValueType(), sObjects, ce.getArguments().toArray(new Expression[ce.getArguments().size()]), fieldNameList); } else { return readExpressionObjects(sObjects, exprs, fieldNameList); } } else { return getResultAsCollection(sObjects, fieldNameList); } }
@Override protected Object processCreatorExpression(CreatorExpression expr) String className = expr.getId(); Class cls = null; try List args = expr.getArguments(); if (args != null)
List<org.datanucleus.query.expression.Expression> args = createExpr.getArguments(); if (args != null && !args.isEmpty())
} else if (expr instanceof CreatorExpression) { CreatorExpression ce = (CreatorExpression) expr; appendExpressionList(h, ce.getArguments().<Expression>toArray(new Expression[ce.getArguments().size()]), executionContext); } else if (expr instanceof SubqueryExpression) {
private Collection<Object> readNonEntityObjects(SObject[] sObjects, Expression[] exprs, Class resultClass) throws ConnectionException, SQLException { // Create metadata first. // Assume the data comes back in the same order as the expressions and use first item to get the metadata List<String> fieldNameList = new ArrayList<String>(); List<Expression> fieldNameExprs = new ArrayList<Expression>(); boolean createFieldNameExpressions = resultClass != null; getFieldNameList(sObjects, createFieldNameExpressions, fieldNameList, fieldNameExprs); // Now read the data based on the metadata if (createFieldNameExpressions) { if (exprs != null && exprs.length > 0) { return readCreatorExpressionObjects(resultClass, sObjects, exprs, fieldNameList); } else { return new JDOQLResultClassMapper(resultClass).map(getResultAsCollection(sObjects, fieldNameList), fieldNameExprs.toArray(new Expression[fieldNameExprs.size()])); } } else if (exprs != null && exprs.length > 0) { if (exprs[0] instanceof CreatorExpression) { CreatorExpression ce = (CreatorExpression) exprs[0]; return readCreatorExpressionObjects(ce.getSymbol().getValueType(), sObjects, ce.getArguments().toArray(new Expression[ce.getArguments().size()]), fieldNameList); } else { return readExpressionObjects(sObjects, exprs, fieldNameList); } } else { return getResultAsCollection(sObjects, fieldNameList); } }
} else if (expr instanceof CreatorExpression) { CreatorExpression ce = (CreatorExpression) expr; appendExpressionList(h, ce.getArguments().<Expression>toArray(new Expression[ce.getArguments().size()]), executionContext); } else if (expr instanceof SubqueryExpression) {