throw new QueryException("Query returned null");
}
}
private Query createQuery(boolean forCount) {
SQLSerializer serializer = new SQLSerializer(configuration);
if (union != null) {
serializer.serializeUnion(union, queryMixin.getMetadata(), unionAll);
} else {
serializer.serialize(queryMixin.getMetadata(), forCount);
}
// create Query
if (logger.isDebugEnabled()) {
logger.debug(serializer.toString());
}
Query query = persistenceManager.newQuery("javax.jdo.query.SQL",serializer.toString());
orderedConstants = serializer.getConstants();
queries.add(query);
if (!forCount) {
List<? extends Expression<?>> projection = queryMixin.getMetadata().getProjection();
if (projection.get(0) instanceof FactoryExpression) {