* @return The internal DataNucleus query
*/
protected Query getInternalQuery()
{
// Create a DataNucleus query and set the generic compilation
Query internalQuery =
ec.getStoreManager().getQueryManager().newQuery("JDOQL", ec, toString());
internalQuery.setIgnoreCache(ignoreCache);
if (!subclasses)
{
internalQuery.setSubclasses(false);
}
if (type == QueryType.SELECT)
{
if (resultDistinct != null)
{
internalQuery.setResultDistinct(resultDistinct.booleanValue());
}
internalQuery.setResultClass(resultClass);
internalQuery.setUnique(unique);
}
if (extensions != null)
{
internalQuery.setExtensions(extensions);
}
if (fp != null)
{
internalQuery.setFetchPlan(((JDOFetchPlan)fp).getInternalFetchPlan());
}
if (type == QueryType.SELECT)
{
if (candidates != null)
{
internalQuery.setCandidates(candidates);
}
}
QueryCompilation compilation = getCompilation();
internalQuery.setCompilation(compilation);
return internalQuery;
}