use of com.blazebit.persistence.RestrictionBuilder in project blaze-persistence by Blazebit.
the class PredicateManager method restrict.
@SuppressWarnings({ "rawtypes", "unchecked" })
SubqueryInitiator<RestrictionBuilder<T>> restrict(T builder, String subqueryAlias, String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
superExprLeftSubqueryPredicateBuilderListener = new SuperExpressionLeftHandsideSubqueryPredicateBuilder(subqueryAlias, expr);
RestrictionBuilder<T> restrictionBuilder = (RestrictionBuilder<T>) rootPredicate.startBuilder(new RestrictionBuilderImpl<T>(builder, rootPredicate, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
return subqueryInitFactory.createSubqueryInitiator(restrictionBuilder, superExprLeftSubqueryPredicateBuilderListener, false, getClauseType());
}
use of com.blazebit.persistence.RestrictionBuilder in project blaze-persistence by Blazebit.
the class PredicateManager method restrictSubqueries.
MultipleSubqueryInitiator<RestrictionBuilder<T>> restrictSubqueries(T builder, String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
@SuppressWarnings("unchecked") RestrictionBuilderImpl<T> restrictionBuilder = rootPredicate.startBuilder(new RestrictionBuilderImpl<T>(builder, rootPredicate, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
// We don't need a listener or marker here, because the resulting restriction builder can only be ended, when the initiator is ended
MultipleSubqueryInitiator<RestrictionBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<T>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, getClauseType());
return initiator;
}
use of com.blazebit.persistence.RestrictionBuilder in project blaze-persistence by Blazebit.
the class PredicateManager method restrict.
@SuppressWarnings({ "rawtypes", "unchecked" })
SubqueryBuilder<RestrictionBuilder<T>> restrict(T builder, String subqueryAlias, String expression, FullQueryBuilder<?, ?> criteriaBuilder) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
superExprLeftSubqueryPredicateBuilderListener = new SuperExpressionLeftHandsideSubqueryPredicateBuilder(subqueryAlias, expr);
RestrictionBuilder<T> restrictionBuilder = (RestrictionBuilder<T>) rootPredicate.startBuilder(new RestrictionBuilderImpl<T>(builder, rootPredicate, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
return subqueryInitFactory.createSubqueryBuilder(restrictionBuilder, superExprLeftSubqueryPredicateBuilderListener, false, criteriaBuilder, getClauseType());
}
Aggregations