net.sf.jso.sql
Class TableDescriptor

java.lang.Object
  extended bynet.sf.jso.sql.TableDescriptor
All Implemented Interfaces:
java.io.Serializable

public class TableDescriptor
extends java.lang.Object
implements java.io.Serializable

Class for table descritptors. Table descriptors represent tables in a relational database.

See Also:
Serialized Form

Constructor Summary
TableDescriptor()
          Constructs the table descriptor.
TableDescriptor(java.lang.String aName)
          Constructs the table descriptor.
TableDescriptor(java.lang.String aName, java.util.Set aColumnSet)
          Constructs the table descriptor.
TableDescriptor(java.lang.String aName, java.util.Set aColumnSet, java.util.List aConstraintList)
          Constructs the table descriptor.
 
Method Summary
 void addColumn(ColumnDescriptor aColumn)
          Adds a column to the table.
 void addColumns(java.util.Set aColumnSet)
          Adds a collection of columns to this table's column collection.
 void addConstraint(ConstraintDescriptor aConstraint)
          Adds a constraint to the table.
 void addConstraints(java.util.List aConstraintList)
          Adds a list of constraints to this table's constraint list.
 void clearColumns()
          Clears the table's collection of columns.
 void clearConstraints()
          Clears the table's list of constraints.
 boolean equals(java.lang.Object o)
          Indicates whether some other table descriptor is "equal to" this one.
 java.util.Set getColumns()
          Gets the table's collection of columns.
 java.util.List getConstraints()
          Gets the table's list of constraints.
 java.lang.String getName()
          Gets table's name.
 int hashCode()
          Returns a hash code value for the table descriptor.
 void removeColumn(ColumnDescriptor aColumn)
          Removes a column from the table.
 void removeConstraint(ConstraintDescriptor aConstraint)
          Removes a constraint from the table.
 void setName(java.lang.String aName)
          Sets table's name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDescriptor

public TableDescriptor()
Constructs the table descriptor.


TableDescriptor

public TableDescriptor(java.lang.String aName)
Constructs the table descriptor.

Parameters:
aName - The table's name.

TableDescriptor

public TableDescriptor(java.lang.String aName,
                       java.util.Set aColumnSet)
Constructs the table descriptor.

Parameters:
aName - The table's name.
aColumnSet - The set of columns of the table. Elements of the set must be ColumnDescriptor objects.

TableDescriptor

public TableDescriptor(java.lang.String aName,
                       java.util.Set aColumnSet,
                       java.util.List aConstraintList)
Constructs the table descriptor.

Parameters:
aName - The table's name.
aColumnSet - The set of columns of the table. Elements of the set must be ColumnDescriptor objects.
aConstraintList - List of constraints of the table. Elements of the list must be ConstraintDescriptor objects.
Method Detail

setName

public void setName(java.lang.String aName)
Sets table's name.

Parameters:
aName - A name for the table.

getName

public java.lang.String getName()
Gets table's name.

Returns:
Table's name.

addColumn

public void addColumn(ColumnDescriptor aColumn)
Adds a column to the table.

Parameters:
aColumn - The column to be added.

removeColumn

public void removeColumn(ColumnDescriptor aColumn)
Removes a column from the table.

Parameters:
aColumn - The column to be removed.

addColumns

public void addColumns(java.util.Set aColumnSet)
Adds a collection of columns to this table's column collection.

Parameters:
aColumnSet - The set of columns of the table. Elements of the set must be ColumnDescriptor objects.

clearColumns

public void clearColumns()
Clears the table's collection of columns.


getColumns

public java.util.Set getColumns()
Gets the table's collection of columns.

Returns:
A collection of ColumnDescriptor objects.

addConstraint

public void addConstraint(ConstraintDescriptor aConstraint)
Adds a constraint to the table.

Parameters:
aConstraint - The constraint to be added.

removeConstraint

public void removeConstraint(ConstraintDescriptor aConstraint)
Removes a constraint from the table.

Parameters:
aConstraint - The constraint to be removed.

addConstraints

public void addConstraints(java.util.List aConstraintList)
Adds a list of constraints to this table's constraint list.

Parameters:
aConstraintList - List of constraints to be added. Elements of the list must be ConstraintDescriptor objects.

clearConstraints

public void clearConstraints()
Clears the table's list of constraints.


getConstraints

public java.util.List getConstraints()
Gets the table's list of constraints.

Returns:
A list of ConstraintDescriptor objects.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other table descriptor is "equal to" this one.

Parameters:
o - The object with which to compare.
Returns:
true if the table descriptor is the same as the table descriptor argument; false otherwise.

hashCode

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

Returns:
A hash code value for the table descriptor.