Class Update
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.dml.Expression
-
- com.feedzai.commons.sql.abstraction.dml.Update
-
- All Implemented Interfaces:
Serializable
public class Update extends Expression
Represents the UPDATE operator.- Since:
- 2.0.0
- Author:
- Rui Vilao(rui.vilao@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 Update(Expression table)Creates a new instance ofUpdate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Updatefrom(Expression from)Adds the FROM expression.List<Expression>getColumns()Gets the columns.ExpressiongetFrom()Gets the FROM expression.ExpressiongetTable()Gets the table.ExpressiongetWhere()Gets the WHERE expression.booleanhasFrom()Checks whether the FROM expression is defined.booleanhasWhere()Checks whether the WHERE expression is defined.Updateset(Expression... exps)The set keyword.Updateset(Collection<? extends Expression> exps)The set keyword.Stringtranslate()Translates the expression.Updatewhere(Expression where)Adds the WHERE 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
-
Update
public Update(Expression table)
Creates a new instance ofUpdate.- Parameters:
table- The table to update.
-
-
Method Detail
-
set
public Update set(Expression... exps)
The set keyword.- Parameters:
exps- The expressions.- Returns:
- This expression.
-
translate
public String translate()
Description copied from class:ExpressionTranslates the expression.- Specified by:
translatein classExpression- Returns:
- A translation of the implementing expression.
-
getTable
public Expression getTable()
Gets the table.- Returns:
- The table.
-
getColumns
public List<Expression> getColumns()
Gets the columns.- Returns:
- The columns.
-
getFrom
public Expression getFrom()
Gets the FROM expression.- Returns:
- The FROM expression.
-
hasFrom
public boolean hasFrom()
Checks whether the FROM expression is defined.- Returns:
- true if the FROM expression is defined, false otherwise.
-
getWhere
public Expression getWhere()
Gets the WHERE expression.- Returns:
- The WHERE expression.
-
hasWhere
public boolean hasWhere()
Checks whether the WHERE expression is defined.- Returns:
- true if the WHERE expression is defined, false otherwise.
-
set
public Update set(Collection<? extends Expression> exps)
The set keyword.- Parameters:
exps- The expressions.- Returns:
- This expression.
-
from
public Update from(Expression from)
Adds the FROM expression.- Parameters:
from- The FROM expression.- Returns:
- This expression.
-
where
public Update where(Expression where)
Adds the WHERE expression.- Parameters:
where- The WHERE expression.- Returns:
- This expression.
-
-