Search in sources :

Example 1 with TupleResult

use of org.hibernate.sql.results.graph.tuple.TupleResult in project hibernate-orm by hibernate.

the class SqlTuple method createDomainResult.

@Override
public DomainResult createDomainResult(String resultVariable, DomainResultCreationState creationState) {
    final JavaType javaType = ((SqmExpressible<?>) valueMapping).getExpressibleJavaType();
    final int[] valuesArrayPositions = new int[expressions.size()];
    for (int i = 0; i < expressions.size(); i++) {
        valuesArrayPositions[i] = creationState.getSqlAstCreationState().getSqlExpressionResolver().resolveSqlSelection(expressions.get(i), javaType, creationState.getSqlAstCreationState().getCreationContext().getMappingMetamodel().getTypeConfiguration()).getValuesArrayPosition();
    }
    return new TupleResult(valuesArrayPositions, resultVariable, javaType);
}
Also used : JavaType(org.hibernate.type.descriptor.java.JavaType) SqmExpressible(org.hibernate.query.sqm.SqmExpressible) TupleResult(org.hibernate.sql.results.graph.tuple.TupleResult)

Aggregations

SqmExpressible (org.hibernate.query.sqm.SqmExpressible)1 TupleResult (org.hibernate.sql.results.graph.tuple.TupleResult)1 JavaType (org.hibernate.type.descriptor.java.JavaType)1