com.ibm.dse.tools.workbench.base
Interface TableRow

All Known Implementing Classes:
DefaultTableRow

public interface TableRow

This interface defines the behavior of any repository table row


Method Summary
 void copyCascade(Repository paramRepository, boolean exactGroup)
          This method copies a row from a repository to another.
 void copyCascadeForImporting(Repository paramRepository, boolean exactGroup)
          This method copies a row from a repository to a workspace while importing
 void copyParentGroupsTree(Repository destinationRep, boolean exactGroup)
          Copies all the parent groups tree (the groups containing the row) of a row to a destination repository
 TableRow copyTo(Repository paramRepository)
          This method copies a row from a repository to another.
 TableRow createOpenEdition()
          This method creates an Open Edition of a row.
 void delete()
          This method deletes this row
 void deleteCascade()
          Deletes a row and all its related rows from the repository
 void deregisterRefence()
          This method discounts a use reference.
 TableRow duplicate()
          This method creates a new row with the same values as the actual row
 void flush()
          This method persists the pending modification, creation or deletion of this row
 TableRow getContainerGroup()
          Returns the row representing the group that contains this object
 TableRow getDestinationRowByName(Workspace destRepository)
          This method returns the row with the same name as the actual from a Workspace
 int getDestinationRowStatus(Workspace destRepository)
          This method checks for the existence of any version of this row in a Workspace
 java.lang.String[] getErrorList()
          Returns the list of error messages for a row after validate has been called.
 java.lang.String getLastCommitedValueAt(int column)
          This method returns the last commited value for this row.
 java.lang.String getLastValueAt(int column)
          This method returns the last commited value for this row.
 java.lang.String getNextVersion(Repository repository)
          Proposes a new version code based on the last version code of the object stored in the repository
 TableRow[] getRelated(int relation, Clause where, int[] orderBy)
          Returns the rows of another table based on a relationship and the values of this row
 Table getTable()
          Returns the table of the row
 java.lang.String getValueAt(int column)
          Returns the value contained in a column of this row
 void importToWorkspace(Workspace ws)
          This method copies a row from a repository to a workspace
 boolean isDeleted()
          Indicates if row has been deleted from the database
 boolean isInError()
          Indicates if last validation has caused errors
 boolean isModified()
          Indicates if the row has been changed since last flush
 boolean isNew()
          Returns the insertion status of this row (true if it is not inserted yet)
 boolean isVersioned()
          Indicates if this row is versioned or an open edition
 void markCommited()
          This method marks the row stated as committed
 void registerReference()
          This method increments the count of use references.
 void restoreInserted()
          This method restores the status of an inserted row since the last commit or rollback
 void restoreModified()
          This method restores the state of the row to the last commit or rollback
 void setContainerGroup(java.lang.String grpCode)
          This method sets the Container group of a row
 void setOtherVersionsInactive()
          This method searches for other editions of the row in the Repository where it is stored and marks them as inactive
 void setTable(Table table)
          Sets the table of the row
 void setValueAt(int column, java.lang.String value)
          Sets the value in a column of this row
 void setValues(java.lang.String[] values)
          Sets the values of all columns of this row
 java.lang.String[] validate()
          Evaluates and returns the list of validation error messages for this row and marks it as inError if there are errors
 TableRow version(java.lang.String newVersion, Repository repository)
          Versions this row, copying it to a repository, based on the version process for its table
 

Method Detail

copyCascade

public void copyCascade(Repository paramRepository,
                        boolean exactGroup)
                 throws WorkbenchException
This method copies a row from a repository to another.

It also copies all the needed data such as parent rows, related rows and container group.

Parameters:
paramRepository - com.ibm.dse.tools.workbench.base.Repository The repository to where copy the row
exactGroup - boolean Indicator of whether the row has to be attached to the container group by CODE (true) or by NAME (false)
Throws:
WorkbenchException - an error ocurred while copying the row

copyCascadeForImporting

public void copyCascadeForImporting(Repository paramRepository,
                                    boolean exactGroup)
                             throws WorkbenchException
This method copies a row from a repository to a workspace while importing

It also copies all the needed data such as parent rows, related rows and container group.

Parameters:
paramRepository - com.ibm.dse.tools.workbench.base.Repository The repository to where copy the row
exactGroup - boolean Indicator of whether the row has to be attached to the container group by CODE (true) or by NAME (false)
Throws:
WorkbenchException - an error ocurred while copying the row

copyParentGroupsTree

public void copyParentGroupsTree(Repository destinationRep,
                                 boolean exactGroup)
                          throws WorkbenchException
Copies all the parent groups tree (the groups containing the row) of a row to a destination repository
Parameters:
destinationRep - com.ibm.dse.tools.workbench.base.Repository The destination repository
exactGroup - boolean Indicator of whether the row has to be attached to the container group by CODE (true) or by NAME (false)
Throws:
WorkbenchException -  

copyTo

public TableRow copyTo(Repository paramRepository)
                throws WorkbenchException
This method copies a row from a repository to another.
Parameters:
paramRepository - com.ibm.dse.tools.workbench.base.Repository The repository to where copy the row
Returns:
com.ibm.dse.tools.workbench.base.TableRow The copy of the row in the destination repository
Throws:
WorkbenchException - When the row can not be copied

createOpenEdition

public TableRow createOpenEdition()
                           throws WorkbenchException
This method creates an Open Edition of a row.

It duplicates the row and makes all its childs to point to this new version.

Returns:
com.ibm.dse.tools.workbench.base.TableRow The open edition
Throws:
WorkbenchException -  

delete

public void delete()
            throws RepositoryException
This method deletes this row
Throws:
RepositoryException -  

deleteCascade

public void deleteCascade()
                   throws WorkbenchException
Deletes a row and all its related rows from the repository
Throws:
WorkbenchException -  

deregisterRefence

public void deregisterRefence()
This method discounts a use reference.

If there is no more uses, the row must be removed from the list in table


duplicate

public TableRow duplicate()
                   throws WorkbenchException
This method creates a new row with the same values as the actual row
Returns:
com.ibm.dse.tools.workbench.base.TableRow
Throws:
WorkbenchException -  

flush

public void flush()
           throws RepositoryException
This method persists the pending modification, creation or deletion of this row
Throws:
RepositoryException -  

getContainerGroup

public TableRow getContainerGroup()
                           throws WorkbenchException
Returns the row representing the group that contains this object
Returns:
com.ibm.dse.tools.workbench.base.TableRow The row representing the container group
Throws:
WorkbenchException -  

getDestinationRowByName

public TableRow getDestinationRowByName(Workspace destRepository)
                                 throws WorkbenchException
This method returns the row with the same name as the actual from a Workspace
Parameters:
destRepository - com.ibm.dse.tools.workbench.base.Workspace
Returns:
TableRow
Throws:
WorkbenchException -  

getDestinationRowStatus

public int getDestinationRowStatus(Workspace destRepository)
                            throws WorkbenchException
This method checks for the existence of any version of this row in a Workspace
Parameters:
destRepository - com.ibm.dse.tools.workbench.base.Workspace
Returns:
int
Throws:
WorkbenchException -  

getErrorList

public java.lang.String[] getErrorList()
Returns the list of error messages for a row after validate has been called.
Returns:
java.lang.String[]

getLastCommitedValueAt

public java.lang.String getLastCommitedValueAt(int column)
This method returns the last commited value for this row.
Parameters:
column - int. The column index
Returns:
java.lang.String

getLastValueAt

public java.lang.String getLastValueAt(int column)
This method returns the last commited value for this row.
Parameters:
column - int. The column index
Returns:
java.lang.String

getNextVersion

public java.lang.String getNextVersion(Repository repository)
                                throws RpNonVersionableTableException,
                                       WorkbenchException
Proposes a new version code based on the last version code of the object stored in the repository
Parameters:
repository - com.ibm.dse.tools.workbench.base.Repository The repository
Returns:
java.lang.String The version code
Throws:
RpNonVersionableTableException - The row which version code is been asked isn't owned by a Versionable table
WorkbenchException -  

getRelated

public TableRow[] getRelated(int relation,
                             Clause where,
                             int[] orderBy)
                      throws WorkbenchException
Returns the rows of another table based on a relationship and the values of this row
Parameters:
relation - int The relationship identifier
where - com.ibm.dse.tools.workbench.base.Clause The where clause to add to the conditions of relationship
orderBy - int[] The list of columns used to order the results
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] The related rows
Throws:
WorkbenchException -  

getTable

public Table getTable()
Returns the table of the row
Returns:
com.ibm.dse.tools.workbench.base.Table

getValueAt

public java.lang.String getValueAt(int column)
Returns the value contained in a column of this row
Parameters:
column - int The identifier of the column to evaluate
Returns:
java.lang.String The value contained in the column

importToWorkspace

public void importToWorkspace(Workspace ws)
                       throws WorkbenchException
This method copies a row from a repository to a workspace
Parameters:
ws - com.ibm.dse.tools.workbench.base.Workspace the destination workspace
Throws:
WorkbenchException -  

isDeleted

public boolean isDeleted()
Indicates if row has been deleted from the database
Returns:
boolean

isInError

public boolean isInError()
Indicates if last validation has caused errors
Returns:
boolean

isModified

public boolean isModified()
Indicates if the row has been changed since last flush
Returns:
boolean

isNew

public boolean isNew()
Returns the insertion status of this row (true if it is not inserted yet)
Returns:
boolean

isVersioned

public boolean isVersioned()
                    throws RpNonVersionableTableException
Indicates if this row is versioned or an open edition
Returns:
boolean
Throws:
RpNonVersionableTableException - The row isn't owned by a Versionable table

markCommited

public void markCommited()
This method marks the row stated as committed

registerReference

public void registerReference()
This method increments the count of use references.

restoreInserted

public void restoreInserted()
This method restores the status of an inserted row since the last commit or rollback

restoreModified

public void restoreModified()
This method restores the state of the row to the last commit or rollback

setContainerGroup

public void setContainerGroup(java.lang.String grpCode)
                       throws WorkbenchException
This method sets the Container group of a row
Parameters:
grpCode - java.lang.String the code of the group to be set as container
Throws:
WorkbenchException -  

setOtherVersionsInactive

public void setOtherVersionsInactive()
                              throws WorkbenchException
This method searches for other editions of the row in the Repository where it is stored and marks them as inactive
Throws:
WorkbenchException -  

setTable

public void setTable(Table table)
Sets the table of the row
Parameters:
table - com.ibm.dse.tools.workbench.base.Table The table to set

setValueAt

public void setValueAt(int column,
                       java.lang.String value)
                throws RepositoryException
Sets the value in a column of this row
Parameters:
column - int The identifier of the column to modify
value - java.lang.String The value to be assigned
Throws:
RepositoryException -  

setValues

public void setValues(java.lang.String[] values)
               throws WorkbenchException
Sets the values of all columns of this row
Parameters:
values - java.lang.String[] The value to be assigned
Throws:
RepositoryException -  

validate

public java.lang.String[] validate()
Evaluates and returns the list of validation error messages for this row and marks it as inError if there are errors
Returns:
java.lang.String[] the errors list

version

public TableRow version(java.lang.String newVersion,
                        Repository repository)
                 throws WorkbenchException
Versions this row, copying it to a repository, based on the version process for its table
Parameters:
newVersion - java.lang.String the new version code
repository - com.ibm.dse.tools.workbench.base.Repository the repository where to copy the versioned row
Returns:
com.ibm.dse.tools.workbench.base.TableRow the versioned row
Throws:
WorkbenchException - The row can not be versioned