com.ibm.dse.tools.workbench.base
Class GroupsTable

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.base.AbstractTable
        |
        +--com.ibm.dse.tools.workbench.base.VersionableTable
              |
              +--com.ibm.dse.tools.workbench.base.GroupsTable

public class GroupsTable
extends VersionableTable

This class represents a table of groups


Field Summary
static int ACTIVE
          The identifier for the ACTIVE column
static int CK_RELEASED
          The identifiers for the check constraint CK_RELEASED
static int CK_SITE
          The identifiers for the check constraint CK_SITE
static int CK_VERSIONED
          The identifiers for the check constraint CK_VERSIONED
static int CODE
          The identifier for the CODE column
static int DESCRIPTION
          The identifier for the DESCRIPTION column
static int GRPGRPCF
          The identifiers for the relationship GRPGRPCF
static int GRPGRPPF
          The identifiers for the relationship GRPFRPPF
static int GRPINSGF
          The identifiers for the relationship GRPINSGF
static int NAME
          The identifier for the NAME column
static int OWNER
          The identifier for the OWNER column
static int PATH
          The identifier for the PATH column
static int REL_COMPONENT_GROUPS
          The identifiers for the relationship REL_COMPONENT_GROUPS
static int REL_ENTITIES
          The identifiers for the relationship REL_ENTITIES
static int REL_INSTANCES
          The identifiers for the relationship REL_INSTANCES
static int REL_OWNER_GROUPS
          The identifiers for the relationship REL_OWNER_GROUPS
static int RELEASED
          The identifier for the RELEASED column
static int SITE
          The identifier for the SITE column
static int TIMESTAMP
          The identifier for the TIMESTAMP column
static int TYPE
          The identifier for the TYPE column
static int VERSION
          The identifier for the VERSION column
static int VERSIONED
          The identifier for the VERSIONED column
 
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
GroupsTable(Repository rpstry)
          This constructor creates a GroupsTable object in a repository
 
Method Summary
 void copyChildGroupsTree(TableRow row, Repository rep)
          This method copies the child groups tree of a GroupsTable row.
 void copyParentGroupsTree(TableRow tableRow, Repository destinationRep, boolean exactGroup)
          Copies all the parent groups hierarchy of a group to a repository
 TableRow createOpenEdition(TableRow row)
          Creates an open edition of a group row
 void createRelations()
          This method creates the relationships for a table
 int getActiveColumn()
          Returns the Active column identifier
 TableRow[] getChildGroups(TableRow parentGroup)
          Returns the groups owned by a group
 TableRow[] getChildGroupsTree(TableRow group)
          Returns the groups hierarchy owned by a group including it
 int getCodeColumn()
          Returns the Code column identifier
 java.lang.String getCompletePath(TableRow group)
          Returns a string with the concatenation of all parent names separated by dots
 TableRow getContainerGroup(TableRow versionableRow)
          This method returns the group containing the versionableRow group row passed as parameter
 TableRow[] getEntities(TableRow group)
          Returns the entity rows owned by a group
 TableRow[] getInstances(TableRow group)
          Returns the instance rows owned by a group
 int getNameColumn()
          Returns the Name column identifier
 int getOwnerColumn()
          Returns the Owner column identifier
 TableRow getParentGroup(TableRow childGroup)
          Returns the group owning a group
 TableRow[] getParentGroupsTree(TableRow group)
          Returns the groups hierarchy owning a group
 int getReleasedColumn()
          Returns the Released column identifier
 TableRow[] getRootGroups(Clause where, int[] orderBy)
          Returns the groups rows stored in the table not being owned by another group
 int getTimeStampColumn()
          Returns the TimeStamp column identifier
 int getVersionColumn()
          Returns the Version column identifier
 int getVersionedColumn()
          Returns the Versioned column identifier
 boolean hasSelfGeneratedPk()
          This method indicates if the field in the primary key must be generated automatically
 void importChildGroupsTree(Workspace ws, TableRow row)
          This method imports the child groups tree of a GroupsTable row, but not its contents
 void importGroupContents(Workspace ws, TableRow group)
          Imports from a repository to a workspace the rows owned by a group row
 void importToWorkspace(Workspace ws, TableRow row)
          Copies a row of a GroupsTable object from a repository to a workspace.
 void preInsert(TableRow row)
          This method is called before inserting a row
 void preUpdate(TableRow row)
          This method is called before modifying a row
 TableRow[] rowsToBeRemoved(TableRow[] rows)
          Returns all the related rows that a remove process performed on a row set 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.
 void setContainerGroup(TableRow versionableRow, java.lang.String grpCode)
          This method sets the Container group of a group row
 java.lang.String[] validate(TableRow row)
          This method checks the correctness of a group row based on application rules
 TableRow version(TableRow versionableRow, java.lang.String newVersion, Repository repository)
          This method versions a group and copies the generated version to the repository.
 
Methods inherited from class com.ibm.dse.tools.workbench.base.VersionableTable
alterFkFields, alterRelatedRows, copyOwner, copyParentGroupsTree, getContainerGroup, getContainerGroup, getDistinctNames, getVersions, getWorkspaceContainerGroup, isAValidVersionNumber, isVersioned, setContainerGroup, updateOpenEditionFields, updateVersionFields
 
Methods inherited from class com.ibm.dse.tools.workbench.base.AbstractTable
add, areTriggersActive, cleanRollbackData, count, createTableRow, createTableRow, exportToFile, flush, getAlias, getChecks, getChecks, getColumnLengths, getColumns, getColumnsString, getColumnsString, getConnection, getCreateChecksStrings, getCreateFksStrings, getCreateIndexesStrings, getCreatePkString, getCreateTableString, getDefaultVersion, getFks, getIndexes, getName, getPk, getPkValue, getRelated, getRelations, getRepository, getTimestamp, getUniqueValue, importFromString, isInPk, isRequired, postDelete, postInsert, postUpdate, preDelete, registerDeletedRow, registerInsertedRow, registerModifiedRow, removeFromList, restoreRows, retrieveAll, retrieveByPk, retrieveDistinct, setAlias, setRepository, setTriggersState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE

public static final int CODE
The identifier for the CODE column

NAME

public static final int NAME
The identifier for the NAME column

VERSION

public static final int VERSION
The identifier for the VERSION column

SITE

public static final int SITE
The identifier for the SITE column

TYPE

public static final int TYPE
The identifier for the TYPE column

RELEASED

public static final int RELEASED
The identifier for the RELEASED column

VERSIONED

public static final int VERSIONED
The identifier for the VERSIONED column

TIMESTAMP

public static final int TIMESTAMP
The identifier for the TIMESTAMP column

OWNER

public static final int OWNER
The identifier for the OWNER column

ACTIVE

public static final int ACTIVE
The identifier for the ACTIVE column

DESCRIPTION

public static final int DESCRIPTION
The identifier for the DESCRIPTION column

PATH

public static final int PATH
The identifier for the PATH column

GRPINSGF

public static final int GRPINSGF
The identifiers for the relationship GRPINSGF

REL_INSTANCES

public static final int REL_INSTANCES
The identifiers for the relationship REL_INSTANCES

REL_ENTITIES

public static final int REL_ENTITIES
The identifiers for the relationship REL_ENTITIES

REL_COMPONENT_GROUPS

public static final int REL_COMPONENT_GROUPS
The identifiers for the relationship REL_COMPONENT_GROUPS

GRPGRPPF

public static final int GRPGRPPF
The identifiers for the relationship GRPFRPPF

REL_OWNER_GROUPS

public static final int REL_OWNER_GROUPS
The identifiers for the relationship REL_OWNER_GROUPS

GRPGRPCF

public static final int GRPGRPCF
The identifiers for the relationship GRPGRPCF

CK_SITE

public static final int CK_SITE
The identifiers for the check constraint CK_SITE

CK_RELEASED

public static final int CK_RELEASED
The identifiers for the check constraint CK_RELEASED

CK_VERSIONED

public static final int CK_VERSIONED
The identifiers for the check constraint CK_VERSIONED
Constructor Detail

GroupsTable

public GroupsTable(Repository rpstry)
This constructor creates a GroupsTable object in a repository
Parameters:
rpstry - com.ibm.dse.tools.workbench.base.DefaultRepository The repository in wich create the table
Method Detail

copyChildGroupsTree

public void copyChildGroupsTree(TableRow row,
                                Repository rep)
                         throws WorkbenchException
This method copies the child groups tree of a GroupsTable row.
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
rep - com.ibm.dse.tools.workbench.base.Repository
Throws:
WorkbenchException -  

copyParentGroupsTree

public void copyParentGroupsTree(TableRow tableRow,
                                 Repository destinationRep,
                                 boolean exactGroup)
                          throws WorkbenchException
Copies all the parent groups hierarchy of a group to a repository
Overrides:
copyParentGroupsTree in class VersionableTable
Parameters:
tableRow - com.ibm.dse.tools.workbench.base.TableRow The entity to copy
destinationRep - com.ibm.dse.tools.workbench.base.Repository The repository where to copy
exactGroup - boolean Indicator of whether the row has to be attached to the container group by CODE (true) or by NAME (false)
Throws:
WorkbenchException -  

createOpenEdition

public TableRow createOpenEdition(TableRow row)
                           throws WorkbenchException
Creates an open edition of a group row
Overrides:
createOpenEdition in class VersionableTable
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow the original row
Returns:
com.ibm.dse.tools.workbench.base.TableRow the open edition row
Throws:
WorkbenchException -  

createRelations

public void createRelations()
                     throws WBInvalidArgumentException
This method creates the relationships for a table
Overrides:
createRelations in class AbstractTable
Throws:
WBInvalidArgumentException - There is an error creating relationships.

getActiveColumn

public int getActiveColumn()
Returns the Active column identifier
Overrides:
getActiveColumn in class VersionableTable
Returns:
int

getChildGroups

public TableRow[] getChildGroups(TableRow parentGroup)
                          throws WorkbenchException
Returns the groups owned by a group
Parameters:
parentGroup - com.ibm.dse.tools.workbench.base.TableRow the parent group
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] the owned groups
Throws:
WorkbenchException -  

getChildGroupsTree

public TableRow[] getChildGroupsTree(TableRow group)
                              throws WorkbenchException
Returns the groups hierarchy owned by a group including it
Parameters:
group - com.ibm.dse.tools.workbench.base.TableRow the parent group
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] the owned groups hierarchy
Throws:
WorkbenchException -  

getCodeColumn

public int getCodeColumn()
Returns the Code column identifier
Returns:
int

getCompletePath

public java.lang.String getCompletePath(TableRow group)
                                 throws WorkbenchException
Returns a string with the concatenation of all parent names separated by dots
Parameters:
group - com.ibm.dse.tools.workbench.base.TableRow
Returns:
java.lang.String
Throws:
WorkbenchException -  

getContainerGroup

public TableRow getContainerGroup(TableRow versionableRow)
                           throws WorkbenchException
This method returns the group containing the versionableRow group row passed as parameter
Overrides:
getContainerGroup in class VersionableTable
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow The row whose group must be returned
Returns:
com.ibm.dse.tools.workbench.base.TableRow The group containing the versionableRow
Throws:
WorkbenchException -  

getEntities

public TableRow[] getEntities(TableRow group)
                       throws WorkbenchException
Returns the entity rows owned by a group
Parameters:
group - com.ibm.dse.tools.workbench.base.TableRow
Returns:
com.ibm.dse.tools.workbench.base.TableRow[]
Throws:
WorkbenchException -  

getInstances

public TableRow[] getInstances(TableRow group)
                        throws WorkbenchException
Returns the instance rows owned by a group
Parameters:
group - com.ibm.dse.tools.workbench.base.TableRow
Returns:
com.ibm.dse.tools.workbench.base.TableRow[]
Throws:
WorkbenchException -  

getNameColumn

public int getNameColumn()
Returns the Name column identifier
Overrides:
getNameColumn in class VersionableTable
Returns:
int

getOwnerColumn

public int getOwnerColumn()
Returns the Owner column identifier
Overrides:
getOwnerColumn in class VersionableTable
Returns:
int

getParentGroup

public TableRow getParentGroup(TableRow childGroup)
                        throws WorkbenchException
Returns the group owning a group
Parameters:
childGroup - com.ibm.dse.tools.workbench.base.TableRow the child group
Returns:
com.ibm.dse.tools.workbench.base.TableRow the parent group
Throws:
WorkbenchException -  

getParentGroupsTree

public TableRow[] getParentGroupsTree(TableRow group)
                               throws WorkbenchException
Returns the groups hierarchy owning a group
Parameters:
group - com.ibm.dse.tools.workbench.base.TableRow
Returns:
com.ibm.dse.tools.workbench.base.TableRow[]
Throws:
WorkbenchException -  

getReleasedColumn

public int getReleasedColumn()
Returns the Released column identifier
Overrides:
getReleasedColumn in class VersionableTable
Returns:
int

getRootGroups

public TableRow[] getRootGroups(Clause where,
                                int[] orderBy)
                         throws WorkbenchException
Returns the groups rows stored in the table not being owned by another group
Parameters:
where - com.ibm.dse.tools.workbench.base.Clause A clause to restrict the root groups to be returned
orderBy - int[] The order in which the groups are returned
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] the root groups
Throws:
WorkbenchException -  

getTimeStampColumn

public int getTimeStampColumn()
Returns the TimeStamp column identifier
Overrides:
getTimeStampColumn in class VersionableTable
Returns:
int

getVersionColumn

public int getVersionColumn()
Returns the Version column identifier
Overrides:
getVersionColumn in class VersionableTable
Returns:
int

getVersionedColumn

public int getVersionedColumn()
Returns the Versioned column identifier
Overrides:
getVersionedColumn in class VersionableTable
Returns:
int

hasSelfGeneratedPk

public boolean hasSelfGeneratedPk()
This method indicates if the field in the primary key must be generated automatically
Overrides:
hasSelfGeneratedPk in class AbstractTable
Returns:
boolean

importChildGroupsTree

public void importChildGroupsTree(Workspace ws,
                                  TableRow row)
                           throws WorkbenchException
This method imports the child groups tree of a GroupsTable row, but not its contents
Parameters:
ws - com.ibm.dse.tools.workbench.base.Workspace
row - com.ibm.dse.tools.workbench.base.TableRow
Throws:
WorkbenchException -  

importGroupContents

public void importGroupContents(Workspace ws,
                                TableRow group)
                         throws WorkbenchException
Imports from a repository to a workspace the rows owned by a group row
Parameters:
ws - com.ibm.dse.tools.workbench.base.WorkSpace the destination workspace
group - com.ibm.dse.tools.workbench.base.TableRow
Throws:
WorkbenchException -  

importToWorkspace

public void importToWorkspace(Workspace ws,
                              TableRow row)
                       throws WorkbenchException
Copies a row of a GroupsTable object from a repository to a workspace.

This method overwrites the generic importToWorkSpace

Overrides:
importToWorkspace in class VersionableTable
Parameters:
ws - com.ibm.dse.tools.workbench.base.WorkSpace
row - com.ibm.dse.tools.workbench.base.TableRow
Throws:
WorkbenchException -  

preInsert

public void preInsert(TableRow row)
               throws RepositoryException
This method is called before inserting a row
Overrides:
preInsert in class AbstractTable
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
Throws:
RepositoryException -  

preUpdate

public void preUpdate(TableRow row)
               throws RepositoryException
This method is called before modifying a row
Overrides:
preUpdate in class AbstractTable
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
Throws:
RepositoryException -  

rowsToBeRemoved

public TableRow[] rowsToBeRemoved(TableRow[] rows)
                           throws WorkbenchException
Returns all the related rows that a remove process performed on a row set will remove.
Overrides:
rowsToBeRemoved in class VersionableTable
Parameters:
rows - com.ibm.dse.tools.workbench.base.TableRow the rows to be removed
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] the related rows that would de removed
Throws:
WorkbenchException - An error occurred while retrieving the rows to be removed.

rowsToBeRemoved

protected void rowsToBeRemoved(TableRow row,
                               java.util.Hashtable rowList)
                        throws WorkbenchException
Adds to a Hashtable the related rows that a remove process performed on a row will remove.
Overrides:
rowsToBeRemoved in class VersionableTable
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
rowList - java.util.Hashtable
Throws:
WorkbenchException - An error ocurred while retrieving the rows to be removed.

setContainerGroup

public void setContainerGroup(TableRow versionableRow,
                              java.lang.String grpCode)
                       throws WorkbenchException
This method sets the Container group of a group row
Overrides:
setContainerGroup in class VersionableTable
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow The group row
grpCode - java.lang.String The code of the group to be set as container
Throws:
WorkbenchException -  

validate

public java.lang.String[] validate(TableRow row)
This method checks the correctness of a group row based on application rules

It returns the list of error strings or null if there are no errors

Overrides:
validate in class AbstractTable
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow The row to validate
Returns:
java.lang.String[]

version

public TableRow version(TableRow versionableRow,
                        java.lang.String newVersion,
                        Repository repository)
                 throws WorkbenchException
This method versions a group and copies the generated version to the repository. (The outer process calling this method must ensure that all the contents of the group are also versioned and transferred to the repository).
Overrides:
version in class VersionableTable
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow The group row to be versioned
newVersion - java.lang.String The version code
repository - com.ibm.dse.tools.workbench.base.Repository The repository where to copy the versioned group row
Returns:
com.ibm.dse.tools.workbench.base.TableRow The versioned group row
Throws:
WorkbenchException -