QueryTree optimizedQT;
QueryEvaluator evaluator;
public synchronized void compile() throws SpeedoException, MedorException, ExpressionException {
if (status == UNDEFINED)
throw new SpeedoException("Impossible to compile an undefined query");
if (status == COMPILED)
return;
long timeToCompile = System.currentTimeMillis();
boolean debug = logger.isLoggable(BasicLevel.DEBUG);
// create a speedoQL object with a filter string
String filter = qd.filter;
filter = '(' + filter + ')';
// create representations of the parameters list and the variable
// list
toHashtableParams(qd.parameters, ";,");
toHashtableVars(qd.variables, ";,");
Manager miManager = mapper.getMetaInfoManager();
if (miManager == null)
throw new SpeedoException(
"A non null Meta information manager is needed");
try {
jf.getPClassMapping(
qd.candidateClass.getName(),
classLoader);
} catch (Exception e) {
throw new SpeedoException(e);
}
SimpleNode node = null;
try {
node = new SpeedoQL(new CharArrayReader(filter.toCharArray())).SpeedoQL();
} catch (ParseException e) {
throw new SpeedoException(
"Impossible to parse the filter and to create AST", e);
}
SpeedoQLVariableVisitor sqvv = new SpeedoQLVariableVisitor(
node, miManager, varParserlogger, hparams, hvars, qd.order,
qd.candidateClass.getName(), qd.includeSubClasses);