Search in sources :

Example 1 with RestrictionBuilderImpl

use of com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl in project blaze-persistence by Blazebit.

the class PredicateManager method restrictCase.

CaseWhenStarterBuilder<RestrictionBuilder<T>> restrictCase(T builder) {
    @SuppressWarnings("unchecked") RestrictionBuilder<T> restrictionBuilder = rootPredicate.startBuilder(new RestrictionBuilderImpl<T>(builder, rootPredicate, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
    caseExpressionBuilderListener = new CaseExpressionBuilderListener((RestrictionBuilderImpl<T>) restrictionBuilder);
    return caseExpressionBuilderListener.startBuilder(new CaseWhenBuilderImpl<RestrictionBuilder<T>>(restrictionBuilder, caseExpressionBuilderListener, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
}
Also used : CaseExpressionBuilderListener(com.blazebit.persistence.impl.builder.predicate.CaseExpressionBuilderListener) RestrictionBuilderImpl(com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl) RestrictionBuilder(com.blazebit.persistence.RestrictionBuilder)

Example 2 with RestrictionBuilderImpl

use of com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl in project blaze-persistence by Blazebit.

the class PredicateManager method restrictSimpleCase.

SimpleCaseWhenStarterBuilder<RestrictionBuilder<T>> restrictSimpleCase(T builder, Expression caseOperand) {
    @SuppressWarnings("unchecked") RestrictionBuilder<T> restrictionBuilder = rootPredicate.startBuilder(new RestrictionBuilderImpl<T>(builder, rootPredicate, subqueryInitFactory, expressionFactory, parameterManager, getClauseType()));
    caseExpressionBuilderListener = new CaseExpressionBuilderListener((RestrictionBuilderImpl<T>) restrictionBuilder);
    return caseExpressionBuilderListener.startBuilder(new SimpleCaseWhenBuilderImpl<RestrictionBuilder<T>>(restrictionBuilder, caseExpressionBuilderListener, expressionFactory, caseOperand, subqueryInitFactory, parameterManager, getClauseType()));
}
Also used : CaseExpressionBuilderListener(com.blazebit.persistence.impl.builder.predicate.CaseExpressionBuilderListener) RestrictionBuilderImpl(com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl) RestrictionBuilder(com.blazebit.persistence.RestrictionBuilder)

Example 3 with RestrictionBuilderImpl

use of com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl 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());
}
Also used : Expression(com.blazebit.persistence.parser.expression.Expression) SuperExpressionLeftHandsideSubqueryPredicateBuilder(com.blazebit.persistence.impl.builder.predicate.SuperExpressionLeftHandsideSubqueryPredicateBuilder) RestrictionBuilderImpl(com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl) RestrictionBuilder(com.blazebit.persistence.RestrictionBuilder)

Example 4 with RestrictionBuilderImpl

use of com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl 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());
}
Also used : Expression(com.blazebit.persistence.parser.expression.Expression) SuperExpressionLeftHandsideSubqueryPredicateBuilder(com.blazebit.persistence.impl.builder.predicate.SuperExpressionLeftHandsideSubqueryPredicateBuilder) RestrictionBuilderImpl(com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl) RestrictionBuilder(com.blazebit.persistence.RestrictionBuilder)

Aggregations

RestrictionBuilder (com.blazebit.persistence.RestrictionBuilder)4 RestrictionBuilderImpl (com.blazebit.persistence.impl.builder.predicate.RestrictionBuilderImpl)4 CaseExpressionBuilderListener (com.blazebit.persistence.impl.builder.predicate.CaseExpressionBuilderListener)2 SuperExpressionLeftHandsideSubqueryPredicateBuilder (com.blazebit.persistence.impl.builder.predicate.SuperExpressionLeftHandsideSubqueryPredicateBuilder)2 Expression (com.blazebit.persistence.parser.expression.Expression)2