|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.common.sql.schema.DatabaseTable
A DatabaseTable
represents a database table ! It is just an
array of TableColumns
objects.
Keep it mind that ArrayList
is not synchronized...
Field Summary | |
private java.util.ArrayList |
columns
ArrayList of DatabaseColumn . |
private java.lang.String |
name
Database table name. |
private static long |
serialVersionUID
|
Constructor Summary | |
|
DatabaseTable(java.lang.String name)
Creates a new DatabaseTable instance. |
private |
DatabaseTable(java.lang.String name,
java.util.ArrayList columns)
Creates a new DatabaseTable instance. |
|
DatabaseTable(java.lang.String name,
int nbOfColumns)
Creates a new DatabaseTable instance. |
Method Summary | |
void |
addColumn(DatabaseColumn column)
Adds a DatabaseColumn object to this table.
|
boolean |
equals(java.lang.Object other)
Two DatabaseColumn are considered equal if they have the
same name and the same columns. |
boolean |
equalsIgnoreType(java.lang.Object other)
This function is the same as equals but ignores the column type. |
DatabaseColumn |
getColumn(java.lang.String columnName)
Returns the DatabaseColumn object matching the given column
name or null if not found (the case is ignored). |
DatabaseColumn |
getColumn(java.lang.String columnName,
boolean isCaseSensitive)
Returns the DatabaseColumn object matching the given column
name or null if not found (the case can be enforced). |
java.util.ArrayList |
getColumns()
Returns a list of DatabaseColumn objects describing the
columns of this table.
|
java.lang.String |
getName()
Gets the name of the table. |
java.util.ArrayList |
getUniqueColumns()
Returns a list of DatabaseColumn objects representing the
unique columns of this table.
|
java.lang.String |
getXml()
Get xml information about this table. |
void |
mergeColumns(DatabaseTable table)
Merges this table with the given table's columns. |
void |
remove(DatabaseColumn column)
Drops a DatabaseColumn object from this table.
|
void |
remove(java.lang.String columnName)
Drops a DatabaseColumn object from this table.
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private java.lang.String name
private java.util.ArrayList columns
ArrayList
of DatabaseColumn
.
Constructor Detail |
public DatabaseTable(java.lang.String name)
DatabaseTable
instance.
name
- table namepublic DatabaseTable(java.lang.String name, int nbOfColumns)
DatabaseTable
instance.
name
- table namenbOfColumns
- number of columnsprivate DatabaseTable(java.lang.String name, java.util.ArrayList columns)
DatabaseTable
instance.
name
- table namecolumns
- columns listMethod Detail |
public java.lang.String getName()
public void addColumn(DatabaseColumn column)
DatabaseColumn
object to this table.
Warning! The underlying ArrayList
is not synchronized.
column
- a DatabaseColumn
valuepublic void remove(java.lang.String columnName)
DatabaseColumn
object from this table.
Warning! The underlying ArrayList
is not synchronized.
columnName
- a String
that maps to a
DatabaseColumn
valuepublic void remove(DatabaseColumn column)
DatabaseColumn
object from this table.
Warning! The underlying ArrayList
is not synchronized.
column
- a DatabaseColumn
valuepublic void mergeColumns(DatabaseTable table) throws java.sql.SQLException
table
- the table to merge
java.sql.SQLException
- if the schemas conflictpublic java.util.ArrayList getColumns()
DatabaseColumn
objects describing the
columns of this table.
Warning! The underlying ArrayList
is not synchronized.
ArrayList
of DatabaseColumn
public java.util.ArrayList getUniqueColumns()
DatabaseColumn
objects representing the
unique columns of this table.
Warning! The underlying ArrayList
is not synchronized.
ArrayList
of DatabaseColumn
objectspublic DatabaseColumn getColumn(java.lang.String columnName)
DatabaseColumn
object matching the given column
name or null
if not found (the case is ignored).
columnName
- column name to look for
DatabaseColumn
value or null
public DatabaseColumn getColumn(java.lang.String columnName, boolean isCaseSensitive)
DatabaseColumn
object matching the given column
name or null
if not found (the case can be enforced).
columnName
- column name to look forisCaseSensitive
- true if name matching must be case sensitive
DatabaseColumn
value or null
public boolean equals(java.lang.Object other)
DatabaseColumn
are considered equal if they have the
same name and the same columns.
other
- the object to compare with
true
if the tables are equalpublic boolean equalsIgnoreType(java.lang.Object other)
other
- the object to compare with
true
if the table are equal ignoring the columns
typeequals(Object)
public java.lang.String getXml()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |