use of org.hibernate.hql.spi.QueryTranslator in project hibernate-orm by hibernate.
the class MultiInheritanceImplicitDowncastTest method testMultiJoinAddition.
private void testMultiJoinAddition(String hql) {
final HQLQueryPlan plan = sessionFactory().getQueryPlanCache().getHQLQueryPlan(hql, false, Collections.EMPTY_MAP);
assertEquals(1, plan.getTranslators().length);
final QueryTranslator translator = plan.getTranslators()[0];
final String generatedSql = translator.getSQLString();
int sub1JoinColumnIndex = generatedSql.indexOf(".base_sub_1");
assertNotEquals("Generated SQL doesn't contain a join for 'base' with 'PolymorphicSub1' via 'base_sub_1':\n" + generatedSql, -1, sub1JoinColumnIndex);
int sub2JoinColumnIndex = generatedSql.indexOf(".base_sub_2");
assertNotEquals("Generated SQL doesn't contain a join for 'base' with 'PolymorphicSub2' via 'base_sub_2':\n" + generatedSql, -1, sub2JoinColumnIndex);
}
Aggregations