use of com.blazebit.persistence.HavingOrBuilder in project blaze-persistence by Blazebit.
the class HavingOrBuilderImpl method havingSubquery.
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public SubqueryInitiator<RestrictionBuilder<HavingOrBuilder<T>>> havingSubquery(String subqueryAlias, String expression) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
superExprLeftSubqueryPredicateBuilderListener = new SuperExpressionLeftHandsideSubqueryPredicateBuilder(subqueryAlias, expr);
RestrictionBuilder<HavingOrBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<HavingOrBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.HAVING));
return subqueryInitFactory.createSubqueryInitiator(restrictionBuilder, superExprLeftSubqueryPredicateBuilderListener, false, ClauseType.HAVING);
}
use of com.blazebit.persistence.HavingOrBuilder 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;
}
use of com.blazebit.persistence.HavingOrBuilder in project blaze-persistence by Blazebit.
the class HavingOrBuilderImpl method havingExpressionSubqueries.
@Override
public MultipleSubqueryInitiator<HavingOrBuilder<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<HavingOrBuilder<T>> initiator = new MultipleSubqueryInitiatorImpl<HavingOrBuilder<T>>(this, predicate, new ExpressionBuilderEndedListener() {
@Override
public void onBuilderEnded(ExpressionBuilder builder) {
HavingOrBuilderImpl.this.predicate.getChildren().add((Predicate) builder.getExpression());
currentMultipleSubqueryInitiator = null;
}
}, subqueryInitFactory, ClauseType.HAVING);
currentMultipleSubqueryInitiator = initiator;
return initiator;
}
use of com.blazebit.persistence.HavingOrBuilder in project blaze-persistence by Blazebit.
the class HavingOrBuilderImpl method havingSubquery.
@Override
public SubqueryBuilder<RestrictionBuilder<HavingOrBuilder<T>>> havingSubquery(String subqueryAlias, String expression, FullQueryBuilder<?, ?> criteriaBuilder) {
Expression expr = expressionFactory.createSimpleExpression(expression, true);
superExprLeftSubqueryPredicateBuilderListener = new SuperExpressionLeftHandsideSubqueryPredicateBuilder(subqueryAlias, expr);
RestrictionBuilder<HavingOrBuilder<T>> restrictionBuilder = startBuilder(new RestrictionBuilderImpl<HavingOrBuilder<T>>(this, this, subqueryInitFactory, expressionFactory, parameterManager, ClauseType.HAVING));
return subqueryInitFactory.createSubqueryBuilder(restrictionBuilder, superExprLeftSubqueryPredicateBuilderListener, false, criteriaBuilder, ClauseType.HAVING);
}
Aggregations