- java.lang.Object
-
- org.datanucleus.store.rdbms.sql.SQLStatement
-
- org.datanucleus.store.rdbms.sql.UpdateStatement
-
public class UpdateStatement extends SQLStatement
SQL UPDATE Statement representation. This will create a statement likeUPDATE {tbl} SET {expr}={val}, {expr}={val}, ... WHERE {boolExpr} [AND|OR] {boolExpr} ...
Any joins are converted into a WHERE clause likeEXISTS (SELECT * FROM OTHER_TBL ...)
-
-
Field Summary
Fields Modifier and Type Field Description protected SQLExpression[]
updates
Array of update expressions when the statement is an UPDATE.-
Fields inherited from class org.datanucleus.store.rdbms.sql.SQLStatement
candidateClassName, clr, EXTENSION_LOCK_FOR_UPDATE, EXTENSION_LOCK_FOR_UPDATE_NOWAIT, EXTENSION_SQL_TABLE_NAMING_STRATEGY, extensions, joins, namer, parent, primaryTable, queryGenerator, rdbmsMgr, requiresJoinReorder, sql, tableGroups, tableNamerByName, tables, where
-
-
Constructor Summary
Constructors Constructor Description UpdateStatement(RDBMSStoreManager rdbmsMgr, Table table, DatastoreIdentifier alias, String tableGroupName, Map<String,Object> extensions)
Constructor for an UPDATE statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SQLText
getSQLText()
boolean
hasUpdates()
void
setUpdates(SQLExpression[] exprs)
Method to set the UPDATE clause of the statement.-
Methods inherited from class org.datanucleus.store.rdbms.sql.SQLStatement
addAndConditionToJoinForTable, addExtension, addJoin, getCandidateClassName, getClassLoaderResolver, getDatastoreAdapter, getJoinConditionForJoin, getJoinForTable, getJoinTypeForTable, getNumberOfTableGroups, getNumberOfTables, getParentStatement, getPrimaryTable, getQueryGenerator, getRDBMSManager, getSQLExpressionFactory, getTable, getTable, getTableForDatastoreContainer, getTableGroup, getTableNamer, getValueForExtension, invalidateStatement, isChildStatementOf, join, join, join, join, join, join, log, putSQLTableInGroup, removeCrossJoin, setCandidateClassName, setClassLoaderResolver, setQueryGenerator, whereAnd, whereOr
-
-
-
-
Field Detail
-
updates
protected SQLExpression[] updates
Array of update expressions when the statement is an UPDATE.
-
-
Constructor Detail
-
UpdateStatement
public UpdateStatement(RDBMSStoreManager rdbmsMgr, Table table, DatastoreIdentifier alias, String tableGroupName, Map<String,Object> extensions)
Constructor for an UPDATE statement.- Parameters:
rdbmsMgr
- Store Managertable
- The primary table to UPDATEalias
- Alias for the primary tabletableGroupName
- Group name for the primary tableextensions
- Any extensions (optional)
-
-
Method Detail
-
setUpdates
public void setUpdates(SQLExpression[] exprs)
Method to set the UPDATE clause of the statement.- Parameters:
exprs
- The update clause expression
-
hasUpdates
public boolean hasUpdates()
-
getSQLText
public SQLText getSQLText()
- Overrides:
getSQLText
in classSQLStatement
-
-