|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colle.sql.schema.Table
Model abstraction of a relational table. Created: 21 Feb 2001
Constructor Summary | |
(package private) |
Table(File pxFile,
TableBuilder pxTableBuilder)
Constructs a relational table from a node in a DOM tree. |
|
Table(String psName)
Constructs a table with limited state (use for dropping foreign tables only). |
Method Summary | |
(package private) void |
addForeignKey(String psName,
org.jdom.Element pxData,
Column pxColumn)
Constructs and adds the foreign key to the list of foreign keys. |
(package private) void |
addIndex(String psName,
boolean pbUnique,
Column pxColumn)
Constructs and adds the index to the list of indexes. |
(package private) void |
connectForeignKeys(RelationalModel pxModel)
Connects foreign keys to foreign indexes. |
void |
create(Connection pxConnection)
Creates the table, dropping it first if necessary, in the database of the given connection. |
void |
drop(Connection pxConnection)
Drops the table in the database of the given connection. |
boolean |
exists(Connection pxConnection)
Checks if the table exist in the database of the given connection. |
List |
getColumns()
Returns the full set of columns. |
File |
getFile()
Returns the containing the table definition. |
Index |
getIndex(String psName)
Returns a specific named index. |
Map |
getIndexes()
Returns all of the indexes, not including the primary key and foreign keys. |
String |
getName()
Returns the name of the table. |
String |
getPackage()
Returns the name of the package. |
Index |
getPrimaryKey()
Returns the primary key index. |
boolean |
hasReferenceTable(Table pxTable)
Checks weather this table has a foreign key reference to the specified table. |
void |
index(Connection pxConnection)
Creates indexes on this table in the database of the given connection. |
void |
indexForeignKeys(Connection pxConnection)
Creates foreign key indexes on this table in the database of the given connection. |
boolean |
isSequence()
check for sequences on table columns. |
void |
load(File pxCSVFile,
Connection pxConnection)
Loads the date from the file specified into this table in the database of the given connection. |
void |
lockTable(Connection pxConnection)
Locks this table for multiple operations. |
void |
sequence(Connection pxConnection)
Drop/Create sequences for columns within this table in the database of the given connection. |
(package private) void |
setPrimaryKey(Column pxColumn)
Defines the column as part of the primary key. |
void |
unlockTable(Connection pxConnection)
Unlocks this table when previously locked with lockTable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Table(String psName)
psName
- name of table that will be dropped.Table(File pxFile, TableBuilder pxTableBuilder)
pxFile
- table node containing the table definition.Method Detail |
public File getFile()
public String getName()
public String getPackage()
public List getColumns()
public Index getIndex(String psName)
public Map getIndexes()
public Index getPrimaryKey()
public boolean hasReferenceTable(Table pxTable)
public void create(Connection pxConnection)
public void drop(Connection pxConnection)
public boolean exists(Connection pxConnection)
public void load(File pxCSVFile, Connection pxConnection)
public void index(Connection pxConnection)
public void indexForeignKeys(Connection pxConnection)
public boolean isSequence()
public void sequence(Connection pxConnection)
public void lockTable(Connection pxConnection) throws SQLException
SQLException
public void unlockTable(Connection pxConnection) throws SQLException
SQLException
void setPrimaryKey(Column pxColumn)
pxColumn
- the column that is part of the primary key.void addIndex(String psName, boolean pbUnique, Column pxColumn)
psName
- name of the index, the table name and an underscore are
prepended to the name before creation.pbUnique
- true if the index is an unique index.pxColumn
- the column that is part of the index.void addForeignKey(String psName, org.jdom.Element pxData, Column pxColumn)
psName
- name of the index, the table name and an underscore are
prepended to the name before creation.pxData
- DOM node containing the foreign key information.pxColumn
- the column that is part of the index.void connectForeignKeys(RelationalModel pxModel)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |