use of org.hibernate.loader.ast.internal.CollectionLoaderSingleKey in project hibernate-orm by hibernate.
the class LoadPlanBuilderTest method testCollectionInitializerCase.
@Test
public void testCollectionInitializerCase(SessionFactoryScope scope) {
final SessionFactoryImplementor sessionFactory = scope.getSessionFactory();
final EntityPersister posterEntityDescriptor = sessionFactory.getRuntimeMetamodels().getMappingMetamodel().getEntityDescriptor(Poster.class);
final PluralAttributeMapping messages = (PluralAttributeMapping) posterEntityDescriptor.findAttributeMapping("messages");
final CollectionLoaderSingleKey loader = new CollectionLoaderSingleKey(messages, LoadQueryInfluencers.NONE, sessionFactory);
assertThat(loader.getSqlAst().getDomainResultDescriptors()).hasSize(1);
assertThat(loader.getSqlAst().getDomainResultDescriptors().get(0)).isInstanceOf(CollectionDomainResult.class);
final CollectionDomainResult domainResult = (CollectionDomainResult) loader.getSqlAst().getDomainResultDescriptors().get(0);
DomainResultGraphPrinter.logDomainResultGraph(loader.getSqlAst().getDomainResultDescriptors());
assertThat(domainResult.getFetches()).isEmpty();
}
Aggregations