Search in sources :

Example 1 with FromClauseAccessImpl

use of org.hibernate.query.results.FromClauseAccessImpl in project hibernate-orm by hibernate.

the class CompleteResultBuilderCollectionStandard method buildResult.

@Override
public DomainResult<?> buildResult(JdbcValuesMetadata jdbcResultsMetadata, int resultPosition, BiFunction<String, String, DynamicFetchBuilderLegacy> legacyFetchResolver, DomainResultCreationState domainResultCreationState) {
    final DomainResultCreationStateImpl creationStateImpl = impl(domainResultCreationState);
    final SessionFactoryImplementor sessionFactory = creationStateImpl.getSessionFactory();
    final FromClauseAccessImpl fromClauseAccess = creationStateImpl.getFromClauseAccess();
    final TableGroup rootTableGroup = pluralAttributeDescriptor.createRootTableGroup(false, navigablePath, tableAlias, null, new SqlAliasBaseConstant(tableAlias), creationStateImpl.getSqlExpressionResolver(), creationStateImpl.getFromClauseAccess(), sessionFactory);
    fromClauseAccess.registerTableGroup(navigablePath, rootTableGroup);
    resolveSelections(rootTableGroup, pluralAttributeDescriptor.getKeyDescriptor(), keyColumnNames, jdbcResultsMetadata, creationStateImpl);
    if (pluralAttributeDescriptor.getIndexDescriptor() != null) {
        resolveSelections(rootTableGroup, pluralAttributeDescriptor.getIndexDescriptor(), indexColumnNames, jdbcResultsMetadata, creationStateImpl);
    }
    resolveSelections(rootTableGroup, pluralAttributeDescriptor.getElementDescriptor(), elementColumnNames, jdbcResultsMetadata, creationStateImpl);
    return pluralAttributeDescriptor.createDomainResult(navigablePath, rootTableGroup, null, domainResultCreationState);
}
Also used : DomainResultCreationStateImpl(org.hibernate.query.results.DomainResultCreationStateImpl) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) SqlAliasBaseConstant(org.hibernate.sql.ast.spi.SqlAliasBaseConstant) FromClauseAccessImpl(org.hibernate.query.results.FromClauseAccessImpl)

Aggregations

SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)1 DomainResultCreationStateImpl (org.hibernate.query.results.DomainResultCreationStateImpl)1 FromClauseAccessImpl (org.hibernate.query.results.FromClauseAccessImpl)1 SqlAliasBaseConstant (org.hibernate.sql.ast.spi.SqlAliasBaseConstant)1 TableGroup (org.hibernate.sql.ast.tree.from.TableGroup)1