@Override public Expression get(ExpressionFactory expressionFactory, String expression, boolean allowQuantifiedPredicates, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return expressionFactory.createScalarExpression(expression, macroConfiguration, usedMacros); } };
@Override public Expression createScalarExpression(String expression) { return delegate.createScalarExpression(expression); }
@Override public Expression get(ExpressionFactory expressionFactory, String expression, boolean allowQuantifiedPredicates, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return expressionFactory.createScalarExpression(expression, macroConfiguration, usedMacros); } };
@Override public Expression createScalarExpression(String expression, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return expressionFactory.createScalarExpression(expression, macroConfiguration, usedMacros); }
@Override public Expression createScalarExpression(String expression, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return delegate.createScalarExpression(expression, macroConfiguration, usedMacros); }
@Override public Expression createScalarExpression(String expression, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return expressionFactory.createScalarExpression(expression, macroConfiguration, usedMacros); }
@Override public Expression createScalarExpression(String expression) { return delegate.createScalarExpression(expression); }
@Override public Expression createScalarExpression(String expression, MacroConfiguration macroConfiguration, Set<String> usedMacros) { return delegate.createScalarExpression(expression, macroConfiguration, usedMacros); }
@Override public SimpleCaseWhenBuilder<T> when(String condition, String thenExpression) { whenExpressions.add(new WhenClauseExpression(expressionFactory.createScalarExpression(condition), expressionFactory.createScalarExpression(thenExpression))); return this; }
@Override public CaseWhenBuilder<T> thenExpression(String expression) { // verify that thenExpression is called for the first time if (thenExpression != null) { throw new IllegalStateException("Method then/thenExpression called multiple times"); } thenExpression = expressionFactory.createScalarExpression(expression); whenClauses.add(new WhenClauseExpression(whenExpression, thenExpression)); return this; }
@Override public Expression createScalarExpression(String expression) { return expressionFactory.createScalarExpression(expression, getDefaultMacroConfiguration(), null); }
@Override public T otherwise(String elseExpression) { if (whenExpressions.isEmpty()) { throw new IllegalStateException("No when clauses specified"); } expression = new SimpleCaseExpression(caseOperandExpression, whenExpressions, expressionFactory.createScalarExpression(elseExpression)); listener.onBuilderEnded(this); return result; }
@Override public T otherwiseExpression(String elseExpression) { verifyBuilderEnded(); if (whenClauses.isEmpty()) { throw new IllegalStateException("No when clauses specified"); } if (expression != null) { throw new IllegalStateException("Method otherwise/otherwiseExpression called multiple times"); } expression = new GeneralCaseExpression(whenClauses, expressionFactory.createScalarExpression(elseExpression)); listener.onBuilderEnded(this); return result; }
@Override public T thenExpression(String expression) { verifyBuilderEnded(); if (predicate.getChildren().isEmpty()) { throw new IllegalStateException("No and clauses specified!"); } if (whenClause != null) { throw new IllegalStateException("Method then/thenExpression called multiple times"); } whenClause = new WhenClauseExpression(predicate, expressionFactory.createScalarExpression(expression)); listener.onBuilderEnded(this); return result; }
@Override public T thenExpression(String expression) { verifyBuilderEnded(); if (predicate.getChildren().isEmpty()) { throw new IllegalStateException("No or clauses specified!"); } if (whenClause != null) { throw new IllegalStateException("Method then/thenExpression called multiple times"); } whenClause = new WhenClauseExpression(predicate, expressionFactory.createScalarExpression(expression)); listener.onBuilderEnded(this); return result; }
@Override @SuppressWarnings("unchecked") public X setExpression(String attributeName, String expression) { verifyBuilderEnded(); addAttribute(attributeName); Expression attributeExpression = expressionFactory.createScalarExpression(expression); parameterManager.collectParameterRegistrations(attributeExpression, ClauseType.SET, this); selectManager.select(attributeExpression, null); return (X) this; }