use of org.hibernate.query.sqm.DynamicInstantiationNature in project hibernate-orm by hibernate.
the class BaseSqmToSqlAstConverter method visitDynamicInstantiation.
@Override
public DynamicInstantiation<?> visitDynamicInstantiation(SqmDynamicInstantiation<?> sqmDynamicInstantiation) {
final SqmDynamicInstantiationTarget<?> instantiationTarget = sqmDynamicInstantiation.getInstantiationTarget();
final DynamicInstantiationNature instantiationNature = instantiationTarget.getNature();
final JavaType<Object> targetTypeDescriptor = interpretInstantiationTarget(instantiationTarget);
final DynamicInstantiation<?> dynamicInstantiation = new DynamicInstantiation<>(instantiationNature, targetTypeDescriptor);
for (SqmDynamicInstantiationArgument<?> sqmArgument : sqmDynamicInstantiation.getArguments()) {
final SqmSelectableNode<?> selectableNode = sqmArgument.getSelectableNode();
if (selectableNode instanceof SqmPath<?>) {
prepareForSelection((SqmPath<?>) selectableNode);
}
final DomainResultProducer<?> argumentResultProducer = (DomainResultProducer<?>) selectableNode.accept(this);
dynamicInstantiation.addArgument(sqmArgument.getAlias(), argumentResultProducer, this);
}
dynamicInstantiation.complete();
return dynamicInstantiation;
}
Aggregations