Search in sources :

Example 11 with BasicFetch

use of org.hibernate.sql.results.graph.basic.BasicFetch in project hibernate-orm by hibernate.

the class AbstractDiscriminatorMapping method generateFetch.

@Override
public BasicFetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
    final SqlAstCreationState sqlAstCreationState = creationState.getSqlAstCreationState();
    final TableGroup tableGroup = sqlAstCreationState.getFromClauseAccess().getTableGroup(fetchParent.getNavigablePath());
    assert tableGroup != null;
    final SqlSelection sqlSelection = resolveSqlSelection(fetchablePath, getUnderlyingJdbcMappingType(), tableGroup, creationState.getSqlAstCreationState());
    return new BasicFetch<>(sqlSelection.getValuesArrayPosition(), fetchParent, fetchablePath, this, null, fetchTiming, creationState);
}
Also used : BasicFetch(org.hibernate.sql.results.graph.basic.BasicFetch) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection)

Aggregations

TableGroup (org.hibernate.sql.ast.tree.from.TableGroup)11 BasicFetch (org.hibernate.sql.results.graph.basic.BasicFetch)11 SqlSelection (org.hibernate.sql.ast.spi.SqlSelection)9 SqlAstCreationState (org.hibernate.sql.ast.spi.SqlAstCreationState)6 ColumnReference (org.hibernate.sql.ast.tree.expression.ColumnReference)5 TableReference (org.hibernate.sql.ast.tree.from.TableReference)5 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)4 EntityMappingType (org.hibernate.metamodel.mapping.EntityMappingType)4 SqlExpressionResolver (org.hibernate.sql.ast.spi.SqlExpressionResolver)4 FetchTiming (org.hibernate.engine.FetchTiming)3 SharedSessionContractImplementor (org.hibernate.engine.spi.SharedSessionContractImplementor)3 NavigablePath (org.hibernate.query.spi.NavigablePath)3 Expression (org.hibernate.sql.ast.tree.expression.Expression)3 BiConsumer (java.util.function.BiConsumer)2 FetchStyle (org.hibernate.engine.FetchStyle)2 IndexedConsumer (org.hibernate.mapping.IndexedConsumer)2 JdbcMapping (org.hibernate.metamodel.mapping.JdbcMapping)2 MappingType (org.hibernate.metamodel.mapping.MappingType)2 NavigableRole (org.hibernate.metamodel.model.domain.NavigableRole)2 DomainResultCreationStateImpl (org.hibernate.query.results.DomainResultCreationStateImpl)2