use of org.hibernate.query.criteria.internal.SelectionImplementor in project hibernate-reactive by hibernate.
the class ReactiveCriteriaQueryImpl method build.
public ReactiveQuery<T> build(CriteriaQueryRenderingContext context, ReactiveQueryExecutor session) {
final SelectionImplementor<?> selection = (SelectionImplementor<?>) getSelection();
ReactiveQuery<T> query = session.createReactiveCriteriaQuery(renderQuery(context), getResultType(), new CriteriaQueryOptions() {
@Override
public SelectionImplementor<?> getSelection() {
return selection;
}
@Override
public InterpretedParameterMetadata getParameterMetadata() {
return context;
}
@Override
@SuppressWarnings("rawtypes")
public List<ValueHandlerFactory.ValueHandler> getValueHandlers() {
return selection == null ? null : selection.getValueHandlers();
}
@Override
public void validate(Type[] returnTypes) {
if (selection != null) {
validateSelection(returnTypes, selection);
}
}
});
for (ImplicitParameterBinding implicitParameterBinding : context.implicitParameterBindings()) {
implicitParameterBinding.bind((TypedQuery<?>) query);
}
return query;
}
Aggregations