this.parameterTypes = parameterTypes;
this.readAhead = metadata.getReadAhead();
this.lazyResultSetLoading = metadata.isLazyResultSetLoading();
// get the parser
EJBQLParser parser = new EJBQLParser(new StringReader(SQLUtil.EMPTY_STRING));
try {
// parse the ejbql into an abstract syntax tree
ASTEJBQL ejbqlNode;
ejbqlNode = parser.parse(catalog, parameterTypes, ejbql);
// translate to sql
sql = ejbqlNode.jjtAccept(this, new StringBuffer()).toString();
} catch (Exception e) {
// if there is a problem reset the state before exiting