use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class RestrictionBuilderImpl method simpleMultipleBuilder.
private <X> MultipleSubqueryInitiator<X> simpleMultipleBuilder(X result, Expression expr, final AbstractQuantifiablePredicateBuilder predicateBuilder) {
MultipleSubqueryInitiatorImpl<X> initiator = new MultipleSubqueryInitiatorImpl<X>(result, expr, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
RestrictionBuilderImpl.this.predicate = predicateBuilder.createPredicate(leftExpression, builder.getExpression(), PredicateQuantifier.ONE);
listener.onBuilderEnded(RestrictionBuilderImpl.this);
}
}, subqueryInitFactory, clause);
startBuilder(predicateBuilder);
predicateBuilder.startBuilder(initiator);
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class WhereAndBuilderImpl method whereExpressionSubqueries.
@Override
public MultipleSubqueryInitiator<WhereAndBuilder<T>> whereExpressionSubqueries(String expression) {
Predicate predicate = expressionFactory.createBooleanExpression(expression, true);
// We don't need a listener or marker here, because the resulting restriction builder can only be ended, when the initiator is ended
MultipleSubqueryInitiator<WhereAndBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<WhereAndBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
WhereAndBuilderImpl.this.predicate.getChildren().add((Predicate) builder.getExpression());
currentMultipleSubqueryInitiator = null;
}
}, subqueryInitFactory, ClauseType.WHERE);
currentMultipleSubqueryInitiator = initiator;
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class BetweenBuilderImpl method startMultipleSubqueryInitiator.
private MultipleSubqueryInitiator<T> startMultipleSubqueryInitiator(Expression expression) {
verifySubqueryBuilderEnded();
MultipleSubqueryInitiator<T> initiator = new MultipleSubqueryInitiatorImpl<T>(result, expression, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
predicate = new BetweenPredicate(left, start, builder.getExpression(), negated);
listener.onBuilderEnded(BetweenBuilderImpl.this);
}
}, subqueryInitFactory, clauseType);
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class HavingAndBuilderImpl method havingSubqueries.
@Override
public MultipleSubqueryInitiator<RestrictionBuilder<HavingAndBuilder<T>>> havingSubqueries(String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
RestrictionBuilderImpl<HavingAndBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<HavingAndBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.HAVING));
// 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<HavingAndBuilder<T>>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<HavingAndBuilder<T>>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, ClauseType.HAVING);
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class HavingAndBuilderImpl method havingExpressionSubqueries.
@Override
public MultipleSubqueryInitiator<HavingAndBuilder<T>> havingExpressionSubqueries(String expression) {
Predicate predicate = expressionFactory.createBooleanExpression(expression, true);
// We don't need a listener or marker here, because the resulting restriction builder can only be ended, when the initiator is ended
MultipleSubqueryInitiator<HavingAndBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<HavingAndBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
HavingAndBuilderImpl.this.predicate.getChildren().add((Predicate) builder.getExpression());
currentMultipleSubqueryInitiator = null;
}
}, subqueryInitFactory, ClauseType.HAVING);
currentMultipleSubqueryInitiator = initiator;
return initiator;
}
Aggregations