Class With
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.dml.Expression
-
- com.feedzai.commons.sql.abstraction.dml.With
-
- All Implemented Interfaces:
Serializable
public class With extends Expression
With SQL Expression.- Since:
- 2.4.0
- Author:
- Francisco Santos (francisco.santos@feedzai.com)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.feedzai.commons.sql.abstraction.dml.Expression
alias, enclosed, joins, ordering, properties, quotes, translator, withNoLock
-
-
Constructor Summary
Constructors Constructor Description With(String alias, Expression expression)Creates a new WITH expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WithandWith(String alias, Expression expression)Adds an alias and expression to the with clause.List<org.apache.commons.lang3.tuple.ImmutablePair<Name,Expression>>getClauses()Gets the clauses.ExpressiongetThen()Gets the then expression.Withthen(Expression thenExpression)Sets the expression to be executed given the clauses.Stringtranslate()Translates the expression.-
Methods inherited from class com.feedzai.commons.sql.abstraction.dml.Expression
alias, asc, desc, enclose, fullOuterJoin, getAlias, getJoins, getOrdering, innerJoin, isAliased, isEnclosed, isQuote, isQuotes, isWithNoLock, leftOuterJoin, rightOuterJoin, unquote, withNoLock
-
-
-
-
Constructor Detail
-
With
public With(String alias, Expression expression)
Creates a new WITH expression.- Parameters:
alias- expression alias.expression- expression to be aliased.
-
-
Method Detail
-
getClauses
public List<org.apache.commons.lang3.tuple.ImmutablePair<Name,Expression>> getClauses()
Gets the clauses.- Returns:
- the clauses.
-
getThen
public Expression getThen()
Gets the then expression.- Returns:
- the then expression.
-
andWith
public With andWith(String alias, Expression expression)
Adds an alias and expression to the with clause.- Parameters:
alias- expression aliasexpression- expression to be aliased.- Returns:
- this object.
-
then
public With then(Expression thenExpression)
Sets the expression to be executed given the clauses.- Parameters:
thenExpression- expression to be executed given the clauses.- Returns:
- this object.
-
translate
public String translate()
Description copied from class:ExpressionTranslates the expression.- Specified by:
translatein classExpression- Returns:
- A translation of the implementing expression.
-
-