// Use existing Hibernate ORM special-purpose parser to extract the parameters metadata.
// I think we have the same details in our AST already, but I keep this for now to not
// diverge too much from ORM code.
try {
HQLQueryPlan plan = new HQLQueryPlan( queryString, false, enabledFilters, factory );
ParameterMetadata parameterMetadata = plan.getParameterMetadata();
//TODO make sure the HQLQueryPlan et al are cached at some level
OgmQuery query = new OgmQuery( queryString, getFlushMode(), this, parameterMetadata, getQueryParserService() );
query.setComment( queryString );
return query;
}