|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the behavior of any repository table object
Method Summary | |
void |
add(TableRow row)
This method adds a row to the list of rows. |
boolean |
areTriggersActive()
This method returns the triggers state |
void |
cleanRollbackData()
This method cleans the lists of inserted, modified and deleted rows, and marks them as commited. |
int |
count(Clause where)
This method counts the rows that accomplish the conditions in the where clause |
void |
createRelations()
This method creates the relationships for a table |
TableRow |
createTableRow()
This method creates a new TableRow object for this table. |
TableRow |
createTableRow(boolean isNew,
java.lang.String[] values)
This method creates a TableRow object for this table with a list of values for the columns. |
void |
exportToFile(java.io.Writer w)
This method sends the table data to a file writer. |
void |
flush()
This method persists the modifications, creations or deletions of rows in this table |
java.lang.String |
getAlias()
This method returns the table alias. |
CheckConstraint[] |
getChecks()
Returns the list of check constraints for this table |
CheckConstraint[] |
getChecks(int column)
Returns the list of check constraints for a column in this table |
int[] |
getColumnLengths()
Returns the list of column lengths. |
java.lang.String[] |
getColumns()
Returns the list of column names for this table |
java.lang.String |
getColumnsString(int[] columnsList,
java.lang.String separator)
This method constructs a String with column names to use in clauses like select, order by, insert, ... |
java.lang.String |
getColumnsString(java.lang.String separator)
This method constructs a String with all column names to use in clauses like select... |
java.lang.String[] |
getCreateChecksStrings()
This method returns the list of sentences to create the check constraints for the table. |
java.lang.String[] |
getCreateFksStrings()
This method returns the list of sentences to create the foreign keys for the table. |
java.lang.String[] |
getCreateIndexesStrings()
This method returns the list of sentences to create the indexes for the table. |
java.lang.String |
getCreatePkString()
This method returns the sentence to create the primary key for the table. |
java.lang.String |
getCreateTableString()
This method returns the sentence to create the table. |
java.util.Hashtable |
getFks()
Returns the list of foreign keys that this table has with other tables |
Index[] |
getIndexes()
Returns the list of indexes. |
java.lang.String |
getName()
Returns the name of the table |
int[] |
getPk()
Returns the list of column identifiers that are part of the primary key of this table |
java.lang.String |
getPkValue(TableRow row)
Returns the Values in the primary key of a row in a String with separators |
TableRow[] |
getRelated(int relation,
java.lang.String[] values,
Clause where,
int[] orderBy)
Returns the rows of another table based on a relationship |
Relationship[] |
getRelations()
Returns the list of relationships that this table has with other tables |
Repository |
getRepository()
Returns repository in wich this table is created |
java.lang.String |
getTimestamp()
Returns a unique value for generation of unique identifiers (primary keys) purpose |
java.lang.String |
getUniqueValue()
Returns a unique value for generation of unique identifiers (primary keys) purpose |
boolean |
hasSelfGeneratedPk()
This method indicates if the field in the primary key must be generated automatically |
void |
importFromString(java.lang.String s)
This method inserts data into the table from a String that can be read from a stream |
boolean |
isInPk(int column)
Checks if a column is part of the primary key |
boolean |
isRequired(int column)
Checks if a column in the table is mandatory |
void |
postDelete(TableRow row)
This method is called after a row is deleted |
void |
postInsert(TableRow row)
This method is called after a row is inserted |
void |
postUpdate(TableRow row)
This method is called after a row is updated |
void |
preDelete(TableRow row)
This method is called before deleting a row |
void |
preInsert(TableRow row)
This method is called before inserting a row |
void |
preUpdate(TableRow row)
This method is called before modifying a row |
void |
registerDeletedRow(TableRow row)
This method adds a row to the list of deleted rows |
void |
registerInsertedRow(TableRow row)
This method adds a row to the list of inserted rows |
void |
registerModifiedRow(TableRow row)
This method adds a row to the list of modified rows |
void |
removeFromList(TableRow row)
This method removes a row from the list of rows |
void |
restoreRows()
This method restores the mapped rows when doing a rollback |
TableRow[] |
retrieveAll(Clause where,
int[] orderBy)
Returns all the rows that accomplish the conditions in a where clause |
TableRow |
retrieveByPk(java.lang.String[] values)
Returns the row corresponding to the values of the primary key |
java.lang.String[] |
retrieveDistinct(int column,
Clause where)
This method retrieve the distinct values in a column in the rows that accomplish the conditions in a where clause |
void |
setRepository(Repository repository)
Sets the repository where this table is located |
void |
setTriggersState(boolean active)
This method sets the triggers state |
java.lang.String[] |
validate(TableRow row)
This method must validate the correctness of a row based on the rules of each object |
Method Detail |
public void add(TableRow row)
row
- com.ibm.dse.tools.workbench.base.TableRowpublic boolean areTriggersActive()
public void cleanRollbackData()
public int count(Clause where) throws RepositoryException
where
- com.ibm.dse.tools.workbench.base.Clause The where clause to applypublic void createRelations() throws WBInvalidArgumentException
public TableRow createTableRow() throws WorkbenchException
public TableRow createTableRow(boolean isNew, java.lang.String[] values) throws WorkbenchException
It can be new or retrieved
isNew
- booleanvalues
- java.lang.String[]public void exportToFile(java.io.Writer w) throws WorkbenchException, java.io.IOException
w
- java.io.Writerpublic void flush() throws RepositoryException
public java.lang.String getAlias()
public CheckConstraint[] getChecks()
public CheckConstraint[] getChecks(int column)
public int[] getColumnLengths()
public java.lang.String[] getColumns()
public java.lang.String getColumnsString(int[] columnsList, java.lang.String separator)
columns
- int[] The list of column identifiers to concatseparator
- java.lang.String The separator between column namespublic java.lang.String getColumnsString(java.lang.String separator)
separator
- java.lang.String The separator between column namespublic java.lang.String[] getCreateChecksStrings()
public java.lang.String[] getCreateFksStrings()
public java.lang.String[] getCreateIndexesStrings()
public java.lang.String getCreatePkString()
public java.lang.String getCreateTableString()
public java.util.Hashtable getFks()
public Index[] getIndexes()
public java.lang.String getName()
public int[] getPk()
public java.lang.String getPkValue(TableRow row)
row
- com.ibm.dse.tools.workbench.base.TableRowpublic TableRow[] getRelated(int relation, java.lang.String[] values, Clause where, int[] orderBy) throws WorkbenchException
relation
- int The relationship identifiervalues
- java.lang.String[] The list of values to apply to the columns of the relationshipwhere
- com.ibm.dse.tools.workbench.base.Clause The where clause to add to the conditions of relationshiporderBy
- int[] The list of columns used to order the resultspublic Relationship[] getRelations()
public Repository getRepository()
public java.lang.String getTimestamp()
public java.lang.String getUniqueValue()
public boolean hasSelfGeneratedPk()
public void importFromString(java.lang.String s) throws WorkbenchException
s
- java.lang.Stringpublic boolean isInPk(int column)
column
- int The column to checkpublic boolean isRequired(int column)
column
- int The identifier of the column to checkpublic void postDelete(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void postInsert(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void postUpdate(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void preDelete(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void preInsert(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void preUpdate(TableRow row) throws RepositoryException
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void registerDeletedRow(TableRow row)
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void registerInsertedRow(TableRow row)
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void registerModifiedRow(TableRow row)
row
- com.ibm.dse.tools.workbench.base.TableRowpublic void removeFromList(TableRow row)
(does not deletes the row from the repository)
com.ibm.dse.tools.workbench.base.TableRow
- The row to be removedpublic void restoreRows()
public TableRow[] retrieveAll(Clause where, int[] orderBy) throws WorkbenchException
where
- com.ibm.dse.tools.workbench.base.Clause The where clause to accomplishorderBy
- int[] The list of column identifiers used to order the resultspublic TableRow retrieveByPk(java.lang.String[] values) throws WorkbenchException
The rows retrieved are added to the list, for cache purpose
values
- String[] The values of the primary key componentspublic java.lang.String[] retrieveDistinct(int column, Clause where) throws WorkbenchException
column
- intwhere
- com.ibm.dse.tools.workbench.base.Clausepublic void setRepository(Repository repository)
repository
- com.ibm.dse.tools.workbench.base.Repository The repository to setpublic void setTriggersState(boolean active)
active
- booleanpublic java.lang.String[] validate(TableRow row)
It returns the list of error strings or null if there are no errors
row
- com.ibm.dse.tools.workbench.base.TableRow the row to validate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |