Package org.apache.empire.db.expr.set
Class DBSetExpr
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.expr.set.DBSetExpr
This class is used for building a set expression of a SQL update statement.
There is no need to explicitly create instances of this class.
Instead use DBColumn.to(Object) factory method.
For the SQL fragment "set name="foo"
you should write: cmd.set( TABLE.NAME.to( "foo" ));
-
Field Summary
FieldsFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.voidaddSQL(DBSQLBuilder sql, long context) Creates the SQL-Command.Copy Commandfinal DBDatabaseReturns the current DBDatabase object.getTable()Returns the current Table object.getValue()voidThe value to which to set the columnMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Field Details
-
column
-
value
-
-
Constructor Details
-
DBSetExpr
Constructs a new DBSetExpr object.- Parameters:
expr- the columnvalue- the value
-
-
Method Details
-
getDatabase
Returns the current DBDatabase object.- Specified by:
getDatabasein classDBObject- Returns:
- the current DBDatabase object
-
getTable
Returns the current Table object.- Returns:
- the current DBRowSet object
-
getColumn
- Returns:
- the column which value should be set
-
getValue
- Returns:
- the value to which to set the column to
-
setValue
The value to which to set the column- Parameters:
value- the new column value
-
addReferencedColumns
Description copied from class:DBExprInternal function to obtain all DBColumnExpr-objects used by this expression.- Specified by:
addReferencedColumnsin classDBExpr- Parameters:
list- list to which all used column expressions must be added
-
copy
Copy Command- Parameters:
newCmd- the new command object- Returns:
- the cloned set expression
-
addSQL
Creates the SQL-Command.
-