2004.04.29


com.jdc.rdb.sql.dml.update
Class Set

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.sql.SQLClause
              |
              +--com.jdc.rdb.sql.dml.DMLClause
                    |
                    +--com.jdc.rdb.sql.dml.update.Set
All Implemented Interfaces:
Clause, Serializable, UpdateClause

public class Set
extends DMLClause
implements UpdateClause

Set represents an Update SQL statement SET clause. The SET clause identifies the Column names and values to be updated.

The column name must identify an updatable column of the specified Table or View. The object IDENTITY column of a typed table is not updatable. Additionally, a column must not be specified more than once.

References:
IBM® DB2 Universal Database™ SQL Reference Volume 1 Version 8, Pages 741-743.

Version:
2.0
Author:
Jay Damon
See Also:
Update, Serialized Form

Field Summary
 
Fields inherited from class com.jdc.rdb.sql.dml.DMLClause
sqlClause
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
Set()
          Constructs a new Set clause object.
Set(String columnValues)
          Constructs a new Set clause object for the specified Database Table Column names and values.
 
Method Summary
 Set addDefault(String column)
          Adds a DEFAULT value for the specified Column name to this Set clause.
 Set addNull(String column)
          Adds a NULL value for the specified Column name to this Set clause.
 Set addValue(String column, Object value)
          Adds an Object value for the specified Column name to this Set clause.
 boolean contains(String column)
          Returns true if the Set list contains the specified Column name.
 String getKeyword()
          Returns the Set clause keyword.
 String getValue()
          Returns the Set clause value.
 Set set(String setClause)
          Sets a user-specified Set clause value.
 String toString()
          Returns a String representation of this Set clause.
 
Methods inherited from class com.jdc.rdb.sql.dml.DMLClause
getKeyword
 
Methods inherited from class com.jdc.rdb.sql.SQLClause
contains, setKeyword, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Set

public Set()
Constructs a new Set clause object.


Set

public Set(String columnValues)
Constructs a new Set clause object for the specified Database Table Column names and values.

Throws:
SQLInvalidException - No column names and values are specified.
See Also:
addValue(String, Object)
Method Detail

addDefault

public Set addDefault(String column)
Adds a DEFAULT value for the specified Column name to this Set clause. A column name is required.

Returns:
This Set clause object.
Throws:
SQLInvalidException - No column name is specified or a Set clause already exists.

addNull

public Set addNull(String column)
Adds a NULL value for the specified Column name to this Set clause. A column name is required.

Returns:
This Set clause object.
Throws:
SQLInvalidException - No column name is specified or a Set clause already exists.

addValue

public Set addValue(String column,
                    Object value)
Adds an Object value for the specified Column name to this Set clause. A column name is required.

Returns:
This Set clause object.
Throws:
SQLInvalidException - No column name is specified or a Set clause already exists.

getKeyword

public String getKeyword()
Returns the Set clause keyword.

Overrides:
getKeyword in class SQLClause
Returns:
The Set clause keyword.

contains

public boolean contains(String column)
Returns true if the Set list contains the specified Column name.

Returns:
True if the list contains the Column name.
False if the list does not contain the Column name.

getValue

public String getValue()
Returns the Set clause value.

Overrides:
getValue in class SQLClause
Returns:
The Set clause value.

set

public Set set(String setClause)
Sets a user-specified Set clause value. Use this method to set a complex Set clause value.

Throws:
SQLInvalidException - No where clause is specified or where clause columnValues are already specified.

toString

public String toString()
Returns a String representation of this Set clause.

Specified by:
toString in interface UpdateClause
Overrides:
toString in class SQLClause
Returns:
A String representation of this Set clause.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.