if (NucleusLogger.QUERY.isDebugEnabled())
{
startTime = System.currentTimeMillis();
NucleusLogger.QUERY.debug(LOCALISER.msg("021044", "JDOQL", getSingleStringQuery()));
}
JavaQueryCompiler compiler = new JDOQLCompiler(om.getMetaDataManager(), om.getClassLoaderResolver(),
null, candidateClass, candidateCollection,
this.filter, getParsedImports(), this.ordering, this.result, this.grouping, this.having,
explicitParameters, explicitVariables);
compilation = compiler.compile(parameterValues, subqueries);
if (QueryUtils.queryReturnsSingleRow(this))
{
compilation.setReturnsSingleRow();
}
if (NucleusLogger.QUERY.isDebugEnabled())
{
NucleusLogger.QUERY.debug(LOCALISER.msg("021045", "JDOQL",
"" + (System.currentTimeMillis() - startTime)));
}
if (subqueries != null)
{
// Compile any subqueries
Iterator iter = subqueries.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry)iter.next();
SubqueryDefinition subqueryDefinition = (SubqueryDefinition)entry.getValue();
Query subquery = subqueryDefinition.getQuery();
if (NucleusLogger.QUERY.isDebugEnabled())
{
startTime = System.currentTimeMillis();
NucleusLogger.QUERY.debug(LOCALISER.msg("021044", "JDOQL",
((AbstractJDOQLQuery)subquery).getSingleStringQuery()));
}
compiler = new JDOQLCompiler(om.getMetaDataManager(), om.getClassLoaderResolver(),
null, subquery.candidateClass, null,
subquery.filter, getParsedImports(), subquery.ordering, subquery.result,
subquery.grouping, subquery.having, null, null);
QueryCompilation subqueryCompilation = compiler.compile(parameterValues, null);
if (QueryUtils.queryReturnsSingleRow(subquery))
{
subqueryCompilation.setReturnsSingleRow();
}
compilation.addSubqueryCompilation((String)entry.getKey(), subqueryCompilation);