use of org.hibernate.sql.ast.spi.SqlSelection in project hibernate-orm by hibernate.
the class BasicValuedCollectionPart method generateFetch.
@Override
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) {
ResultsLogger.LOGGER.debugf("Generating Fetch for collection-part : `%s` -> `%s`", collectionDescriptor.getRole(), nature.getName());
NavigablePath parentNavigablePath = fetchablePath.getParent();
if (parentNavigablePath instanceof EntityIdentifierNavigablePath) {
parentNavigablePath = parentNavigablePath.getParent();
}
final TableGroup tableGroup = creationState.getSqlAstCreationState().getFromClauseAccess().findTableGroup(parentNavigablePath);
final SqlSelection sqlSelection = resolveSqlSelection(fetchablePath, tableGroup, true, creationState);
return new BasicFetch<>(sqlSelection.getValuesArrayPosition(), fetchParent, fetchablePath, this, valueConverter, FetchTiming.IMMEDIATE, creationState);
}
use of org.hibernate.sql.ast.spi.SqlSelection 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);
}
use of org.hibernate.sql.ast.spi.SqlSelection in project hibernate-orm by hibernate.
the class JdbcValuesResultSetImpl method readCurrentRowValues.
private void readCurrentRowValues() {
final ResultSet resultSet = resultSetAccess.getResultSet();
final SharedSessionContractImplementor session = executionContext.getSession();
for (final SqlSelection sqlSelection : sqlSelections) {
try {
currentRowJdbcValues[sqlSelection.getValuesArrayPosition()] = sqlSelection.getJdbcValueExtractor().extract(resultSet, sqlSelection.getJdbcResultSetIndex(), session);
} catch (Exception e) {
throw new HibernateException("Unable to extract JDBC value for position `" + sqlSelection.getJdbcResultSetIndex() + "`", e);
}
}
}
Aggregations