Search in sources :

Example 6 with MultipleSubqueryInitiatorImpl

use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.

the class JoinOnAndBuilderImpl method onExpressionSubqueries.

@Override
public MultipleSubqueryInitiator<JoinOnAndBuilder<T>> onExpressionSubqueries(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<JoinOnAndBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<JoinOnAndBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {

        @Override
        public void onBuilderEnded(ExpressionBuilder builder) {
            JoinOnAndBuilderImpl.this.predicate.getChildren().add((Predicate) builder.getExpression());
            currentMultipleSubqueryInitiator = null;
        }
    }, subqueryInitFactory, ClauseType.JOIN);
    currentMultipleSubqueryInitiator = initiator;
    return initiator;
}
Also used : ExpressionBuilderEndedListener(com.blazebit.persistence.impl.builder.expression.ExpressionBuilderEndedListener) JoinOnAndBuilder(com.blazebit.persistence.JoinOnAndBuilder) MultipleSubqueryInitiatorImpl(com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl) ExpressionBuilder(com.blazebit.persistence.impl.builder.expression.ExpressionBuilder) Predicate(com.blazebit.persistence.parser.predicate.Predicate) CompoundPredicate(com.blazebit.persistence.parser.predicate.CompoundPredicate) ExistsPredicate(com.blazebit.persistence.parser.predicate.ExistsPredicate)

Example 7 with MultipleSubqueryInitiatorImpl

use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.

the class JoinOnBuilderImpl method onExpressionSubqueries.

@Override
public MultipleSubqueryInitiator<JoinOnBuilder<T>> onExpressionSubqueries(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<JoinOnBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<JoinOnBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {

        @Override
        public void onBuilderEnded(ExpressionBuilder builder) {
            rootPredicate.getPredicate().getChildren().add((Predicate) builder.getExpression());
            currentMultipleSubqueryInitiator = null;
        }
    }, subqueryInitFactory, ClauseType.JOIN);
    currentMultipleSubqueryInitiator = initiator;
    return initiator;
}
Also used : ExpressionBuilderEndedListener(com.blazebit.persistence.impl.builder.expression.ExpressionBuilderEndedListener) MultipleSubqueryInitiatorImpl(com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl) JoinOnBuilder(com.blazebit.persistence.JoinOnBuilder) ExpressionBuilder(com.blazebit.persistence.impl.builder.expression.ExpressionBuilder) Predicate(com.blazebit.persistence.parser.predicate.Predicate) CompoundPredicate(com.blazebit.persistence.parser.predicate.CompoundPredicate) ExistsPredicate(com.blazebit.persistence.parser.predicate.ExistsPredicate)

Example 8 with MultipleSubqueryInitiatorImpl

use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.

the class JoinOnBuilderImpl method onSubqueries.

@Override
public MultipleSubqueryInitiator<RestrictionBuilder<JoinOnBuilder<T>>> onSubqueries(String expression) {
    Expression expr = expressionFactory.createSimpleExpression(expression, true);
    RestrictionBuilderImpl<JoinOnBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<JoinOnBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.JOIN));
    // 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<JoinOnBuilder<T>>> initiator = new MultipleSubqueryInitiatorImpl<RestrictionBuilder<JoinOnBuilder<T>>>(restrictionBuilder, expr, new RestrictionBuilderExpressionBuilderListener(restrictionBuilder), subqueryInitFactory, ClauseType.JOIN);
    return initiator;
}
Also used : Expression(com.blazebit.persistence.parser.expression.Expression) MultipleSubqueryInitiatorImpl(com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl) JoinOnBuilder(com.blazebit.persistence.JoinOnBuilder) RestrictionBuilderExpressionBuilderListener(com.blazebit.persistence.impl.RestrictionBuilderExpressionBuilderListener) RestrictionBuilder(com.blazebit.persistence.RestrictionBuilder)

Example 9 with MultipleSubqueryInitiatorImpl

use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.

the class JoinOnOrBuilderImpl method onExpressionSubqueries.

@Override
public MultipleSubqueryInitiator<JoinOnOrBuilder<T>> onExpressionSubqueries(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<JoinOnOrBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<JoinOnOrBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {

        @Override
        public void onBuilderEnded(ExpressionBuilder builder) {
            JoinOnOrBuilderImpl.this.predicate.getChildren().add((Predicate) builder.getExpression());
            currentMultipleSubqueryInitiator = null;
        }
    }, subqueryInitFactory, ClauseType.JOIN);
    currentMultipleSubqueryInitiator = initiator;
    return initiator;
}
Also used : ExpressionBuilderEndedListener(com.blazebit.persistence.impl.builder.expression.ExpressionBuilderEndedListener) JoinOnOrBuilder(com.blazebit.persistence.JoinOnOrBuilder) MultipleSubqueryInitiatorImpl(com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl) ExpressionBuilder(com.blazebit.persistence.impl.builder.expression.ExpressionBuilder) Predicate(com.blazebit.persistence.parser.predicate.Predicate) CompoundPredicate(com.blazebit.persistence.parser.predicate.CompoundPredicate) ExistsPredicate(com.blazebit.persistence.parser.predicate.ExistsPredicate)

Example 10 with MultipleSubqueryInitiatorImpl

use of com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl in project blaze-persistence by Blazebit.

the class LikeBuilderImpl method subqueries.

@Override
public MultipleSubqueryInitiator<EscapeBuilder<T>> subqueries(String expression) {
    Expression expr = expressionFactory.createSimpleExpression(expression);
    ExpressionToEscapeBuilderEndedListener listener = new ExpressionToEscapeBuilderEndedListener();
    return new MultipleSubqueryInitiatorImpl<EscapeBuilder<T>>(new EscapeBuilderImpl<T>(listener, result), expr, listener, subqueryInitFactory, clauseType);
}
Also used : Expression(com.blazebit.persistence.parser.expression.Expression) MultipleSubqueryInitiatorImpl(com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl)

Aggregations

MultipleSubqueryInitiatorImpl (com.blazebit.persistence.impl.MultipleSubqueryInitiatorImpl)19 ExpressionBuilder (com.blazebit.persistence.impl.builder.expression.ExpressionBuilder)11 ExpressionBuilderEndedListener (com.blazebit.persistence.impl.builder.expression.ExpressionBuilderEndedListener)11 Expression (com.blazebit.persistence.parser.expression.Expression)9 CompoundPredicate (com.blazebit.persistence.parser.predicate.CompoundPredicate)8 ExistsPredicate (com.blazebit.persistence.parser.predicate.ExistsPredicate)8 Predicate (com.blazebit.persistence.parser.predicate.Predicate)8 RestrictionBuilder (com.blazebit.persistence.RestrictionBuilder)7 RestrictionBuilderExpressionBuilderListener (com.blazebit.persistence.impl.RestrictionBuilderExpressionBuilderListener)7 HavingAndBuilder (com.blazebit.persistence.HavingAndBuilder)2 HavingOrBuilder (com.blazebit.persistence.HavingOrBuilder)2 JoinOnAndBuilder (com.blazebit.persistence.JoinOnAndBuilder)2 JoinOnBuilder (com.blazebit.persistence.JoinOnBuilder)2 JoinOnOrBuilder (com.blazebit.persistence.JoinOnOrBuilder)2 WhereAndBuilder (com.blazebit.persistence.WhereAndBuilder)2 WhereOrBuilder (com.blazebit.persistence.WhereOrBuilder)2 ParameterExpression (com.blazebit.persistence.parser.expression.ParameterExpression)1 PathExpression (com.blazebit.persistence.parser.expression.PathExpression)1 SubqueryExpression (com.blazebit.persistence.parser.expression.SubqueryExpression)1 BetweenPredicate (com.blazebit.persistence.parser.predicate.BetweenPredicate)1