|
|||||||||
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 | +--com.ibm.dse.tools.workbench.base.InstancesTable
This class represents a table of instances
Field Summary | |
static int |
ACTIVE
The identifier for the ACTIVE column |
static int |
BASE_GROUP
The identifier for the BASE_GROUP column |
static int |
CK_ACTIVE
The identifiers for the check constraint CK_ACTIVE |
static int |
CK_IN_ERROR
The identifier for the check constraint CK_IN_ERROR |
static int |
CK_RELEASED
The identifiers for the check constraint CK_RELEASED |
static int |
CK_VERSIONED
The identifiers for the check constraint CK_VERSIONED |
static int |
CODE
The identifier for the CODE column |
static int |
COMMENT
The identifier for the COMMENT column |
static int |
ENTITY
The identifier for the ENTITY column |
static int |
ICON
The identifier for the ICON column |
static int |
IN_ERROR
The identifier for the IN_ERROR column |
static int |
NAME
The identifier for the NAME column |
static int |
OWNER
The identifier for the OWNER column |
static int |
PARENT
The identifier for the PARENT column |
static int |
PATH
The identifier for the PATH column |
static int |
POSITION
The identifier for the POSITION column |
static int |
REL_CHILD_INSTANCES
The identifiers for the relationship INSINSFK |
static int |
REL_ERRORS
The identifier for the relationship ERRINSFK |
static int |
REL_GROUPS_ASSIGNED
The identifiers for the relationship GRPINSIF |
static int |
REL_OWNED_PROPERTIES
The identifiers for the relationship PRPINSFK |
static int |
RELEASED
The identifier for the RELEASED column |
static int |
TAG
The identifier for the TAG column |
static int |
TIMESTAMP
The identifier for the TIMESTAMP 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 | |
InstancesTable(Repository rpstry)
This constructor creates an InstancesTable object in a repository |
Method Summary | |
void |
copyParentGroupsTree(TableRow tableRow,
Repository destinationRep,
boolean exactGroup)
Copies all the parent groups hierarchy of an instance to a repository |
TableRow |
createOpenEdition(TableRow row)
Creates an open edition of an instance row |
void |
createRelations()
This method creates the relationships for a table |
TableRow |
findReference(TableRow instance,
java.lang.String attName)
Returns the instance referred by a property that corresponds to a cross reference |
int |
getActiveColumn()
Returns the Active column identifier |
TableRow[] |
getChildInstances(TableRow instance,
int[] orderBy)
This method returns the children for the given instance. |
int |
getCodeColumn()
Returns the Code column identifier |
java.lang.String |
getCompletePath(TableRow instance)
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 passed as parameter |
TableRow |
getEntity(TableRow instance)
Returns the row representing the entity defining an instance |
java.lang.String[] |
getErrorMessage(TableRow instance)
Returns the string containing the error message |
Table |
getErrorsTable()
Returns related errors table |
java.lang.String |
getErrorsTableName()
Returns related errors table name |
TableRow |
getGroup(TableRow instance)
This method returns the group where the instance belongs. |
int |
getInErrorColumn()
This method returns the column identifier for the InError field |
TableRow |
getInstanceParent(TableRow instance)
This method returns the instance parent for the given instance. |
int |
getNameColumn()
Returns the Name column identifier |
int |
getOwnerColumn()
Returns the Owner column identifier |
TableRow[] |
getParentInstanceTree(TableRow instance)
Returns all the hierarchy parents of an instance including it |
java.lang.String |
getPathByAttributes(TableRow instance,
java.lang.String[] attNameList)
Returns a string with the concatenation of all parent property values separated by dots |
TableRow[] |
getProperties(TableRow instance)
Returns the properties of an instance |
int |
getReleasedColumn()
Returns the Released column identifier |
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 |
importToWorkspace(Workspace ws,
TableRow row)
Copies a row of this VersionableTable from a repository to a workspace. |
void |
postDelete(TableRow row)
This method validates the composition of the parent of the specified instance |
void |
preInsert(TableRow row)
Before inserting a row, the path must be calculated |
void |
preUpdate(TableRow row)
When updating a row, the path must be recalculated, because the name can be changed |
TableRow[] |
retrieveAll(Clause where,
int[] orderBy)
This method overwrites the AbstractTable retrieveAll behaviour, adding the needed error handling code |
TableRow |
retrieveByPk(java.lang.String[] values)
This method overwrites the AbstractTable retrieveByPk behaviour, adding the needed error handling code |
java.lang.String[] |
retrieveDistinct(int column,
Clause where)
This method overwrites the AbstractTable retrieveDistinct behaviour, adding the needed error handling code |
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. |
void |
setContainerGroup(TableRow versionableRow,
java.lang.String grpCode)
This method sets the Container group of an entity row |
static void |
setValidationActive(boolean activate)
Sets the validation active flag |
java.lang.String[] |
validate(TableRow instance)
This method checks the correctness of an instance row based on application rules |
void |
validateInstanceHierarchy(TableRow instance)
This method validates an instance and his children |
java.lang.String[] |
validateInstancesComposition(TableRow instance)
This method checks the correctness of an instance row based on application rules |
java.lang.String[] |
validateMandatoryProperties(TableRow instance)
This method validates the mandatory properties of a table row |
java.lang.String[] |
validateProperties(TableRow instance)
This method checks the correctness of the properties of a table row |
TableRow |
version(TableRow versionableRow,
java.lang.String newVersion,
Repository repository)
This method versions an instance. |
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,
postInsert,
postUpdate,
preDelete,
registerDeletedRow,
registerInsertedRow,
registerModifiedRow,
removeFromList,
restoreRows,
setAlias,
setRepository,
setTriggersState |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int CODE
public static final int NAME
public static final int TAG
public static final int ICON
public static final int COMMENT
public static final int VERSION
public static final int ENTITY
public static final int PARENT
public static final int POSITION
public static final int OWNER
public static final int RELEASED
public static final int TIMESTAMP
public static final int VERSIONED
public static final int ACTIVE
public static final int BASE_GROUP
public static final int PATH
public static final int IN_ERROR
public static final int REL_GROUPS_ASSIGNED
public static final int REL_CHILD_INSTANCES
public static final int REL_OWNED_PROPERTIES
public static final int REL_ERRORS
public static final int CK_RELEASED
public static final int CK_VERSIONED
public static final int CK_ACTIVE
public static final int CK_IN_ERROR
Constructor Detail |
public InstancesTable(Repository rpstry)
rpstry
- com.ibm.dse.tools.workbench.base.DefaultRepository The repository in wich create the tableMethod Detail |
public void copyParentGroupsTree(TableRow tableRow, Repository destinationRep, boolean exactGroup) throws WorkbenchException
tableRow
- com.ibm.dse.tools.workbench.base.TableRow The entity to copydestinationRep
- com.ibm.dse.tools.workbench.base.Repository The repository where to copyexactGroup
- boolean Indicator of whether the row has to be attached to the container group by CODE (true) or by NAME (false)public TableRow createOpenEdition(TableRow row) throws WorkbenchException
row
- com.ibm.dse.tools.workbench.base.TableRow the original rowpublic void createRelations() throws WBInvalidArgumentException
public TableRow findReference(TableRow instance, java.lang.String attName) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRow The instance that has the referenceattName
- java.lang.String The name of the attribute that has the referencepublic int getActiveColumn()
public TableRow[] getChildInstances(TableRow instance, int[] orderBy) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRoworderBy
- intpublic int getCodeColumn()
public java.lang.String getCompletePath(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRowpublic TableRow getContainerGroup(TableRow versionableRow) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow The row whose group must be returnedpublic TableRow getEntity(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRow The row representing the instancepublic java.lang.String[] getErrorMessage(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRow The row representing the instancepublic Table getErrorsTable()
public java.lang.String getErrorsTableName()
public TableRow getGroup(TableRow instance)
instance
- com.ibm.dse.tools.workbench.base.TableRowpublic int getInErrorColumn()
public TableRow getInstanceParent(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRowpublic int getNameColumn()
public int getOwnerColumn()
public TableRow[] getParentInstanceTree(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRow The row representing the instancepublic java.lang.String getPathByAttributes(TableRow instance, java.lang.String[] attNameList) throws WorkbenchException
A list of attributes names is provided, so these attributes are searched, in the same order of preference that they are provided, between the properties of the current instance. When a property for one of this attributes is found, its value is concatenated to the complete path, separated by a dot
instance
- com.ibm.dse.tools.workbench.base.TableRowattNameList
- java.lang.String[] The list of attribute names to use in properties searchpublic TableRow[] getProperties(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRow The row representing the instancepublic int getReleasedColumn()
public int getTimeStampColumn()
public int getVersionColumn()
public int getVersionedColumn()
public boolean hasSelfGeneratedPk()
public 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 void postDelete(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 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
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 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.Hashtablepublic void setContainerGroup(TableRow versionableRow, java.lang.String grpCode) throws WorkbenchException
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow The entity rowgrpCode
- java.lang.String The code of the group to be set as containerpublic static void setValidationActive(boolean activate)
activate
- booleanpublic java.lang.String[] validate(TableRow instance)
It returns the list of error strings or null if there are no errors
instance
- com.ibm.dse.tools.workbench.base.TableRow The row to validatepublic void validateInstanceHierarchy(TableRow instance) throws WorkbenchException
instance
- com.ibm.dse.tools.workbench.base.TableRowpublic java.lang.String[] validateInstancesComposition(TableRow instance)
It returns the list of error strings or null if there are no errors
instance
- com.ibm.dse.tools.workbench.base.TableRow The row to validatepublic java.lang.String[] validateMandatoryProperties(TableRow instance)
It returns the list of error strings or null if there are no errors
instance
- com.ibm.dse.tools.workbench.base.TableRow The row to validatepublic java.lang.String[] validateProperties(TableRow instance)
It returns the list of error strings or null if there are no errors
instance
- com.ibm.dse.tools.workbench.base.TableRow The row to validatepublic TableRow version(TableRow versionableRow, java.lang.String newVersion, Repository repository) throws WorkbenchException
Only Root Instances can be versioned
versionableRow
- com.ibm.dse.tools.workbench.base.TableRow the instance row to be versionednewVersion
- java.lang.String the version coderepository
- com.ibm.dse.tools.workbench.base.Repository the repository where to copy the versioned row
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |