org.ujac.util.db
Class TableDefinition

java.lang.Object
  extended by org.ujac.util.db.TableDefinition

public class TableDefinition
extends Object

Name: TableDefinition.java
Description: Description of class.

Author:
lauerc

Constructor Summary
TableDefinition(String name)
          Constructs a TableDefinition instance with specific attributes.
TableDefinition(String name, String schema)
          Constructs a TableDefinition instance with specific attributes.
 
Method Summary
 void addAttribute(AttributeDefinition attribute)
          Adds an attribute.
 void clearAttributes()
          Clears the attribute list.
 AttributeDefinition getAttributeByColumn(String columnName)
          Gets an attribute by its column name.
 AttributeDefinition getAttributeByName(String name)
          Gets an attribute by its name.
 List getAttributes()
          Gets the attribute list.
 String getName()
          Gets the table name.
 int getNumPrimaryKeys()
          Gets the number of primary keys.
 AttributeDefinition[] getPrimaryKeys()
          Gets the primary key attributes.
 String getSchema()
          Gets the schema, the table is located at.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableDefinition

public TableDefinition(String name)
Constructs a TableDefinition instance with specific attributes.

Parameters:
name - The table name.

TableDefinition

public TableDefinition(String name,
                       String schema)
Constructs a TableDefinition instance with specific attributes.

Parameters:
name - The table name.
schema - The schema, the table is located at.
Method Detail

getName

public String getName()
Gets the table name.

Returns:
The table name.

getSchema

public String getSchema()
Gets the schema, the table is located at.

Returns:
The schema name.

addAttribute

public void addAttribute(AttributeDefinition attribute)
Adds an attribute.

Parameters:
attribute - The attribute definition.

getAttributeByName

public AttributeDefinition getAttributeByName(String name)
Gets an attribute by its name.

Parameters:
name - The attribute name.
Returns:
The determined attribute definition.

getAttributeByColumn

public AttributeDefinition getAttributeByColumn(String columnName)
Gets an attribute by its column name.

Parameters:
columnName - The attribute column name.
Returns:
The determined attribute definition.

clearAttributes

public void clearAttributes()
Clears the attribute list.


getAttributes

public List getAttributes()
Gets the attribute list.

Returns:
The attribute definition list.

getNumPrimaryKeys

public int getNumPrimaryKeys()
Gets the number of primary keys.

Returns:
The number of primary keys.

getPrimaryKeys

public AttributeDefinition[] getPrimaryKeys()
Gets the primary key attributes.

Returns:
The primary key attributes.

toString

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

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.