use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class WhereOrBuilderImpl method whereSubqueries.
@Override
public MultipleSubqueryInitiator<RestrictionBuilder<WhereOrBuilder<T>>> whereSubqueries(String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
RestrictionBuilderImpl<WhereOrBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<WhereOrBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.WHERE));
// 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<WhereOrBuilder<T>>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<WhereOrBuilder<T>>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, ClauseType.WHERE);
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class WhereOrBuilderImpl method whereExpressionSubqueries.
@Override
public MultipleSubqueryInitiator<WhereOrBuilder<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<WhereOrBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<WhereOrBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
WhereOrBuilderImpl.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 RestrictionBuilderImpl method inSubqueries.
private MultipleSubqueryInitiator<T> inSubqueries(String expression, boolean negated) {
verifyBuilderEnded();
Expression expr = expressionFactory.createSimpleExpression(expression, true);
this.predicate = new InPredicate(negated, leftExpression);
return new MultipleSubqueryInitiatorImpl<T>(result, expr, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
onSubqueryBuilderEnded(builder.getExpression());
listener.onBuilderEnded(RestrictionBuilderImpl.this);
}
}, subqueryInitFactory, clause);
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class WhereAndBuilderImpl method whereSubqueries.
@Override
public MultipleSubqueryInitiator<RestrictionBuilder<WhereAndBuilder<T>>> whereSubqueries(String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
RestrictionBuilderImpl<WhereAndBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<WhereAndBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.WHERE));
// 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<WhereAndBuilder<T>>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<WhereAndBuilder<T>>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, ClauseType.WHERE);
return initiator;
}
use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.
the class HavingOrBuilderImpl method havingSubqueries.
@Override
public MultipleSubqueryInitiator<RestrictionBuilder<HavingOrBuilder<T>>> havingSubqueries(String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
RestrictionBuilderImpl<HavingOrBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<HavingOrBuilder<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<HavingOrBuilder<T>>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<HavingOrBuilder<T>>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, ClauseType.HAVING);
return initiator;
}
Aggregations