Class DBSetExpr


public class DBSetExpr extends DBExpr
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 Details

  • Constructor Details

    • DBSetExpr

      public DBSetExpr(DBColumn expr, Object value)
      Constructs a new DBSetExpr object.
      Parameters:
      expr - the column
      value - the value
  • Method Details

    • getDatabase

      public final DBDatabase getDatabase()
      Returns the current DBDatabase object.
      Specified by:
      getDatabase in class DBObject
      Returns:
      the current DBDatabase object
    • getTable

      public DBRowSet getTable()
      Returns the current Table object.
      Returns:
      the current DBRowSet object
    • getColumn

      public DBColumn getColumn()
      Returns:
      the column which value should be set
    • getValue

      public Object getValue()
      Returns:
      the value to which to set the column to
    • setValue

      public void setValue(Object value)
      The value to which to set the column
      Parameters:
      value - the new column value
    • addReferencedColumns

      public void addReferencedColumns(Set<DBColumn> list)
      Description copied from class: DBExpr
      Internal function to obtain all DBColumnExpr-objects used by this expression.
      Specified by:
      addReferencedColumns in class DBExpr
      Parameters:
      list - list to which all used column expressions must be added
    • copy

      public DBSetExpr copy(DBCommand newCmd)
      Copy Command
      Parameters:
      newCmd - the new command object
      Returns:
      the cloned set expression
    • addSQL

      public void addSQL(DBSQLBuilder sql, long context)
      Creates the SQL-Command.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the SQL-Command
      context - the current SQL-Command context