org.openanzo.sqlscribe
Class Table

java.lang.Object
  extended by org.openanzo.sqlscribe.Table
All Implemented Interfaces:
java.lang.Comparable<Table>, ITable

public class Table
extends java.lang.Object
implements ITable, java.lang.Comparable<Table>

Represents a relational database table for use in the query builder framework.

Author:
Joe Betz

Constructor Summary
Table(java.lang.String name)
          Create a table with the given name
Table(java.lang.String name, java.lang.String alias)
          Create a table with the given name
 
Method Summary
 int compareTo(Table table)
           
 boolean equals(java.lang.Object object)
           
 java.lang.String getAlias()
          Get the table's alias.
 java.lang.String getDeclaration()
          Get the table's declaration string
 int hashCode()
           
 Table reAlias(java.lang.String newAlias)
          Clone this table with a new alias
 void writeAlias(java.lang.StringBuffer buf)
          Write the table's alias string to a buffer
 void writeDeclaration(java.lang.StringBuffer buf)
          Write the table's declaration string to a buffer
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(java.lang.String name)
Create a table with the given name

Parameters:
name - of the table

Table

public Table(java.lang.String name,
             java.lang.String alias)
Create a table with the given name

Parameters:
name - of the table
alias - table's alias name
Method Detail

getAlias

public java.lang.String getAlias()
Description copied from interface: ITable
Get the table's alias. Example: FROM TABLE1 alias,TABLE2

Specified by:
getAlias in interface ITable
Returns:
the table's alias

writeAlias

public void writeAlias(java.lang.StringBuffer buf)
Description copied from interface: ITable
Write the table's alias string to a buffer

Specified by:
writeAlias in interface ITable
Parameters:
buf - buffer to which alias string is written

getDeclaration

public java.lang.String getDeclaration()
Description copied from interface: ITable
Get the table's declaration string

Specified by:
getDeclaration in interface ITable
Returns:
the table's declaration string

writeDeclaration

public void writeDeclaration(java.lang.StringBuffer buf)
Description copied from interface: ITable
Write the table's declaration string to a buffer

Specified by:
writeDeclaration in interface ITable
Parameters:
buf - buffer to which the declaration string is written

reAlias

public Table reAlias(java.lang.String newAlias)
Clone this table with a new alias

Parameters:
newAlias - new alias name
Returns:
new Table with a new alias

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Table table)
Specified by:
compareTo in interface java.lang.Comparable<Table>


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.