org.glite.rgma
Class CreateTableStatement

java.lang.Object
  extended byorg.glite.rgma.CreateTableStatement
All Implemented Interfaces:
java.lang.Cloneable

public class CreateTableStatement
extends java.lang.Object
implements java.lang.Cloneable

A generic CREATE TABLE statement for R-GMA (non-database-specific).


Constructor Summary
CreateTableStatement(java.lang.String tableName)
          Creates a new CreateTableStatement object with no columns from a table name.
CreateTableStatement(java.lang.String tableName, java.util.List columns)
          Creates a new CreateTableStatement object from a table name and list of ColumnDefinitions.
 
Method Summary
 void addColumn(ColumnDefinition colDef)
          Adds a column definition.
 java.lang.Object clone()
          Gets a clone of this object.
 boolean equals(java.lang.Object obj)
          Compares this object with the specified object.
 java.util.List getColumns()
          Gets the list of column definitions.
 java.lang.String getTableName()
          Gets the name of the table.
 int hashCode()
          Returns a hash code value for the object.
 void setColumns(java.util.List columns)
          Sets the columns for this CREATE TABLE statement.
 void setPrimaryKey(java.lang.String colName)
          Sets the primary key of this table to the specified column.
 void setTableName(java.lang.String tableName)
          Sets the table name for this CREATE TABLE statement.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateTableStatement

public CreateTableStatement(java.lang.String tableName,
                            java.util.List columns)
Creates a new CreateTableStatement object from a table name and list of ColumnDefinitions.

Parameters:
tableName - Name of table.
columns - List of ColumnDefinition objects.

CreateTableStatement

public CreateTableStatement(java.lang.String tableName)
Creates a new CreateTableStatement object with no columns from a table name.

Parameters:
tableName - Name of table.
Method Detail

getColumns

public java.util.List getColumns()
Gets the list of column definitions.

Returns:
A List of ColumnDefinition objects.

getTableName

public java.lang.String getTableName()
Gets the name of the table.

Returns:
Returns the tableName.

addColumn

public void addColumn(ColumnDefinition colDef)
Adds a column definition.

Parameters:
colDef - Definition to add.

toString

public java.lang.String toString()
Returns a string representation of the object.

Returns:
A string representation of the object.
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Compares this object with the specified object.

Parameters:
obj - Object to compare.
Returns:
true if this object and the specified object are equal.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns:
a hash code value for this object.
See Also:
Object.hashCode()

setColumns

public void setColumns(java.util.List columns)
Sets the columns for this CREATE TABLE statement.

Parameters:
columns - A List of ColumnDefinition objects.

setTableName

public void setTableName(java.lang.String tableName)
Sets the table name for this CREATE TABLE statement.

Parameters:
tableName - Name of table to create.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Gets a clone of this object.

Returns:
A clone of this object.
Throws:
java.lang.CloneNotSupportedException - If this object does not support cloning.

setPrimaryKey

public void setPrimaryKey(java.lang.String colName)
Sets the primary key of this table to the specified column. Any existing primary key/not null columns are removed from the key. If the specified column is not found, the effect is just to remove all columns from the primary key.

Parameters:
colName - Column to use as primary key.