|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.tools.workbench.base.AbstractTable | +--com.ibm.dse.tools.workbench.base.VersionableTable
This class represents a versionable database table.
A versionable database table supports version, create open edition and import to workspace processes to be performed on its rows.
Fields inherited from class com.ibm.dse.tools.workbench.base.AbstractTable |
alias,
checks,
columnLengths,
columns,
DATA_DELIMITER,
DATA_SEPARATOR,
deletedRows,
ESCAPE_SEQUENCE,
fks,
indexes,
insertedRows,
modifiedRows,
name,
pk,
relations,
repository,
required,
rows,
triggers |
Constructor Summary | |
VersionableTable()
This constructor creates a VersionableTable object |
|
VersionableTable(Repository repository)
This constructor creates an VersionableTable object in a repository. |
Method Summary | |
protected void |
alterFkFields(TableRow origParentRow,
TableRow finalParentRow,
int relation)
Changes the related rows pointing to a parent row to point to a new parent row. |
protected void |
alterRelatedRows(TableRow origParentRow,
TableRow finalParentRow,
int relation)
Changes the related rows pointing to a parent row to point to a new parent row. |
void |
copyOwner(TableRow row,
Repository rep)
Copies the owner of a row to a repository |
abstract void |
copyParentGroupsTree(TableRow tableRow,
Repository destinationRep,
boolean exactGroup)
Copies the container groups tree of a row to another repository. |
protected void |
copyParentGroupsTree(TableRow tableRow,
Repository destinationRep,
int relation,
int column,
boolean exactGroup)
Copies the container groups tree of a row to another repository. |
abstract TableRow |
createOpenEdition(TableRow row)
Creates an open edition for a table row. |
abstract int |
getActiveColumn()
This method returns the column identifier for the Active field of the versionable object |
abstract TableRow |
getContainerGroup(TableRow versionableRow)
This method returns the group containing the row. |
protected TableRow |
getContainerGroup(TableRow versionableRow,
int relation,
int fkColumn)
Returns the group containing the row. |
protected TableRow |
getContainerGroup(TableRow versionableRow,
int relation,
int fkColumn,
Repository destinationRep)
This method returns the group containing the row. |
java.lang.String[] |
getDistinctNames(Clause where)
This method returns the distinct names of the rows in the Versionable object. |
abstract int |
getNameColumn()
This method returns the column identifier for the Name of the versionable object |
abstract int |
getOwnerColumn()
This method returns the column identifier for the Owner of the versionable object |
abstract int |
getReleasedColumn()
This method returns the column identifier for the Released field of the versionable object |
abstract int |
getTimeStampColumn()
This method returns the column identifier for the Timestamp of the versionable object |
abstract int |
getVersionColumn()
This method returns the column identifier for the Version of the versionable object |
abstract int |
getVersionedColumn()
This method returns the column identifier for the Versioned field of the versionable object |
TableRow[] |
getVersions(java.lang.String name)
Returns all the stored versions of a row in a versionable table object. |
protected TableRow |
getWorkspaceContainerGroup(TableRow row,
Workspace ws)
This method returns the group containing the workspace copy of a row. |
void |
importToWorkspace(Workspace ws,
TableRow row)
Copies a row of this VersionableTable from a repository to a workspace. |
boolean |
isAValidVersionNumber(TableRow versionableRow,
java.lang.String versionNumber,
Repository rep)
Checks if a version number is valid for a row stored in this versionable object. |
boolean |
isVersioned(TableRow row)
Tests if a row in this versionable object is versioned. |
TableRow[] |
rowsToBeRemoved(TableRow[] rows)
Returns the rows that a remove process performed on a set of rows will remove. |
protected void |
rowsToBeRemoved(TableRow row,
java.util.Hashtable rowList)
Adds to a Hashtable the related rows that a remove process performed on a row will remove. |
protected void |
setContainerGroup(TableRow versionableRow,
int relation,
int grpColumn,
java.lang.String grpCode)
Sets the container group of a row of this versionable object. |
abstract void |
setContainerGroup(TableRow versionableRow,
java.lang.String grpCode)
Sets the container group of a row of this versionable object. |
void |
updateOpenEditionFields(TableRow versionableRow,
java.lang.String[] newPk)
This method updates the row fields relative to the version process. |
void |
updateVersionFields(TableRow versionableRow,
java.lang.String[] newPk,
java.lang.String newVersion)
This method updates the row fields relative to the version process.. |
abstract TableRow |
version(TableRow versionableRow,
java.lang.String newVersion,
Repository repository)
Versions a row in this versionable object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public VersionableTable()
public VersionableTable(Repository repository)
repository
- com.ibm.dse.tools.workbench.base.Repository the repositoryMethod Detail |
protected void alterFkFields(TableRow origParentRow, TableRow finalParentRow, int relation) throws WorkbenchException
This method sets the values at the columns associated with the foreign key so that the parent row would change from origParentRow to finalParentRow.
origParentRow
- com.ibm.dse.tools.workbench.base.TableRow the initial parent row where the fk points to.finalParentRow
- com.ibm.dse.tools.workbench.base.TableRow the new parent row where the fk would point to.relation
- int the relation between the row and its parent, associated to the foreign key to be altered.protected void alterRelatedRows(TableRow origParentRow, TableRow finalParentRow, int relation) throws WorkbenchException
In addition of altering the fk fields in the related rows so that they change their parent, it also changes the value at their Code column, if applies (that is if they have selfgenerated primary key).
origParentRow
- com.ibm.dse.tools.workbench.base.TableRow the initial parent rowfinalParentRow
- com.ibm.dse.tools.workbench.base.TableRow the new parent row.relation
- int the relation between the related rows and its parentpublic void copyOwner(TableRow row, Repository rep) throws WorkbenchException
row
- com.ibm.dse.tools.workbench.base.TableRowrep
- com.ibm.dse.tools.workbench.base.Repositoryprotected void copyParentGroupsTree(TableRow tableRow, Repository destinationRep, int relation, int column, boolean exactGroup) throws WorkbenchException
This method recursively searches for container groups in the origin repository and copies them to the destination repository.
The method behavior depends on the exactGroup parameter and whether the original container group is versioned or not:
If exactGroup = true and the original container group is versioned, the same version of the container group would be searched for in the destination repository to be set as the container group. If it doesn´t exist the original container group would be copied to the destination repository.
If exactGroup = true and the original container group isn't versioned, an open edition of the container group would be searched for in the destination repository to be set as the container group. If it doesn´t exist the original container group would be copied to the destination repository.
If exactGroup = false, any edition of the original container group in the repository would be set as the container group
tableRow
- com.ibm.dse.tools.workbench.base.TableRow the rowdestinationRep
- com.ibm.dse.tools.workbench.base.Repository the destination repositoryrelation
- int the relation between the VersionableTable object and the Table cointaining the relational rows
representing the relation between the GroupsTable and this VersionableTable (tipically a groups_xxx table)column
- int the column where the Group Code is stored.exactGroup
- boolean indicates whether it must search for exact matching groups in the destination repository.public abstract void copyParentGroupsTree(TableRow tableRow, Repository destinationRep, boolean exactGroup) throws WorkbenchException
tableRow
- com.ibm.dse.tools.workbench.base.TableRow the row whose parent groups tree would be copied.destinationRep
- com.ibm.dse.tools.workbench.base.Repository the destination repository.exactGroup
- boolean indicates whether it must search for exact matching groups in the destination repository.public abstract TableRow createOpenEdition(TableRow row) throws WorkbenchException
An open edition is an edition ready to be worked on it.
row
- com.ibm.dse.tools.workbench.base.TableRowpublic abstract int getActiveColumn()
public abstract TableRow getContainerGroup(TableRow versionableRow) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow The row whose container group must be returnedprotected TableRow getContainerGroup(TableRow versionableRow, int relation, int fkColumn) throws WorkbenchException
If a row is owned by more than one group it returns the active one having the latest timestamp.
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the row whose group must be returnedrelation
- int the relation between the VersionableTable object and the Table containing the rows associating
VersionableTable rows and GroupsTable rows.fkColumn
- int the column in the Table containing the rows associating VersionableTable rows and GroupsTable rows
where the Group Code is stored.If no parent group is found it returns null.
protected TableRow getContainerGroup(TableRow versionableRow, int relation, int fkColumn, Repository destinationRep) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the row whose group must be returnedrelation
- int the relation between the VersionableTable object and the Table containing the rows associating
VersionableTable rows and GroupsTable rows.fkColumn
- int the column in the Table containing the rows associating VersionableTable rows and GroupsTable rows
where the Group Code is stored.If no parent group is found it returns null.
public java.lang.String[] getDistinctNames(Clause where) throws WorkbenchException
where
- com.ibm.dse.tools.workbench.base.Clause A clause to filter the names retrieved.public abstract int getNameColumn()
public abstract int getOwnerColumn()
public abstract int getReleasedColumn()
public abstract int getTimeStampColumn()
public abstract int getVersionColumn()
public abstract int getVersionedColumn()
public TableRow[] getVersions(java.lang.String name) throws WorkbenchException
The search is performed by name.
The returned rows are ordered by timestamp.
name
- java.lang.String The name of the row.protected TableRow getWorkspaceContainerGroup(TableRow row, Workspace ws) throws WorkbenchException
row
- com.ibm.dse.tools.workbench.base.TableRowws
- com.ibm.dse.tools.workbench.base.Workspacepublic void importToWorkspace(Workspace ws, TableRow row) throws WorkbenchException
Rows in VersionableTable objects contained in a Workspace object can not be imported to a Workspace.
This method also copies the parent groups tree if needed.
ws
- com.ibm.dse.tools.workbench.base.Workspace The destination repository.row
- com.ibm.dse.tools.workbench.base.TableRow The row to be copied.public boolean isAValidVersionNumber(TableRow versionableRow, java.lang.String versionNumber, Repository rep) throws WorkbenchException
This method would be tipically used to ensure that only a version number exists in a repository for a named row.
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the row.versionNumber
- java.lang.String the version number.rep
- com.ibm.dse.tools.workbench.base.Repository the repository.public boolean isVersioned(TableRow row)
A row marked as deleted is considered to be non versioned.
row
- com.ibm.dse.tools.workbench.base.TableRow the row.public TableRow[] rowsToBeRemoved(TableRow[] rows) throws WorkbenchException
rows
- com.ibm.dse.tools.workbench.base.TableRow[] the rowsprotected void rowsToBeRemoved(TableRow row, java.util.Hashtable rowList) throws WorkbenchException
row
- com.ibm.dse.tools.workbench.base.TableRowrowList
- java.util.Hashtableprotected void setContainerGroup(TableRow versionableRow, int relation, int grpColumn, java.lang.String grpCode) throws WorkbenchException
This method creates the row in the table relating this VersionableTable row and the Group having grpCode Code.
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the rowrelation
- int the relation between the VersionableTable object and the Table containing the rows associating
VersionableTable rows and GroupsTable rows.grpColumn
- int the column in the Table containing the rows associating VersionableTable rows and GroupsTable rows
where the Group Code is stored.grpCode
- java.lang.String the group codepublic abstract void setContainerGroup(TableRow versionableRow, java.lang.String grpCode) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the rowgrpCode
- java.lang.String the group codepublic void updateOpenEditionFields(TableRow versionableRow, java.lang.String[] newPk) throws RepositoryException
The fields updated are:
the primary key fields are set to be the one passed as a parameter
the Version field is set to be the current date and time
the Versioned field is set to "N"
the Timestamp field is set to be the current date and time
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the rownewPk
- java.lang.String[] the new primary keypublic void updateVersionFields(TableRow versionableRow, java.lang.String[] newPk, java.lang.String newVersion) throws RepositoryException
The fields updated are:
the primary key fields are set to be the one passed as a parameter
the Version field is set to be the version code passed as a parameter
the Versioned field is set to "Y"
the Timestamp field is set to be the current date and time
the Active field is set to be "Y"
the user is set as the owner
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the rownewPk
- java.lang.String[] the new primary keynewVersion
- java.lang.String the new version codepublic abstract TableRow version(TableRow versionableRow, java.lang.String newVersion, Repository repository) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the row to be versioned.newVersion
- java.lang.String the version coderepository
- com.ibm.dse.tools.workbench.base.Repository the repository where the versioned row should be copied.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |