private void compileWithAstQueryTranslator(String hql, boolean scalar) {
Map replacements = new HashMap();
QueryTranslatorFactory ast = new ASTQueryTranslatorFactory();
SessionFactoryImplementor factory = getSessionFactoryImplementor();
QueryTranslator newQueryTranslator = ast.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
newQueryTranslator.compile( replacements, scalar );
}
public void testComponentNoAlias() throws Exception {
// The classic translator doesn't do this right, so don't bother asserting.
compileWithAstQueryTranslator( "from Human where name.first = 'Gavin'", false);