2004.04.29


com.jdc.rdb.sql.dml.insert
Class Columns

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.sql.SQLClause
              |
              +--com.jdc.rdb.sql.dml.DMLClause
                    |
                    +--com.jdc.rdb.sql.dml.insert.Columns
All Implemented Interfaces:
Clause, InsertClause, Serializable

public class Columns
extends DMLClause
implements InsertClause

Columns represents an Insert SQL statement columns clause. The columns clause specifies the columns for which Insert values are provided. Each name must be an unqualified name that identifies a Column of the Table or View.

The same Column must not be identified more than once. A View column that cannot accept inserted values (for example, a column based on an expression) must not be identified.

Omission of the column list is an implicit specification of a list in which every Column of the Table or View is identified in left-to-right order. This list is established when the statement is prepared.

Reference:
IBM® DB2 Universal Database™ SQL Reference Volume 2 Version 8, Pages 604 and 605.

Version:
2.0
Author:
Jay Damon
See Also:
Insert, 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
Columns()
          Constructs a new Columns clause object.
Columns(String columns)
          Constructs a new Columns clause object for the specified Database Table Column names.
 
Method Summary
 Columns addName(String column)
          Adds a Column name to the list of Column names.
 boolean contains(String column)
          Returns true if the Columns list contains the specified Column name.
 String getKeyword()
          Returns the Columns clause keyword.
 String getValue()
          Returns the Columns clause value.
 void setValue(String value)
          Sets the Columns clause value.
 String toString()
          Returns a String representation of this Columns clause.
 
Methods inherited from class com.jdc.rdb.sql.dml.DMLClause
getKeyword
 
Methods inherited from class com.jdc.rdb.sql.SQLClause
contains, setKeyword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Columns

public Columns()
Constructs a new Columns clause object.


Columns

public Columns(String columns)
Constructs a new Columns clause object for the specified Database Table Column names.

Throws:
SQLInvalidException - No Column names are specified.
See Also:
#addName(String, Object)
Method Detail

addName

public Columns addName(String column)
Adds a Column name to the list of Column names. The list of Column names is used to create the Columns clause value. Invoke this method as many times as is required to create a list of Column names.

Returns:
This Columns clause object.

contains

public boolean contains(String column)
Returns true if the Columns 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.

getKeyword

public String getKeyword()
Returns the Columns clause keyword.

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

getValue

public String getValue()
Returns the Columns clause value.

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

setValue

public void setValue(String value)
Sets the Columns clause value. Use this method to specify a custom Columns clause value.

Overrides:
setValue in class SQLClause

toString

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

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

2004.04.29



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