Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.admin.upgrade.common
Class PrepareAttributeColumns

    java.lang.Object
      oracle.ifs.utils.action.AbstractAction
          oracle.ifs.admin.actions.JDBCAction
              oracle.ifs.admin.upgrade.common.CreateDatabaseObjectsAction
                  oracle.ifs.admin.upgrade.common.PrepareAttributeColumns

All Implemented Interfaces:
  Action, IfsParameters

    public abstract class PrepareAttributeColumns

extends CreateDatabaseObjectsAction

A PrepareAttributeColumns is an abstract upgrade action used to add columns and initialize their values in preparation for adding new Attributes that use those columns.

Upgrade actions that extend this class typically run during the pre-upgrade phase.

(Published)

Field Summary

Fields inherited from class oracle.ifs.admin.actions.JDBCAction
`NOLOG`

Fields inherited from class oracle.ifs.utils.action.AbstractAction
`CONTINUE_ON_ERROR, m_defaultOptions, m_options`

Fields inherited from interface oracle.ifs.utils.common.IfsParameters
`APPEND_LOG, DATABASE_URL, DB_USER_NAME, DB_USER_PASSWORD, DOMAIN_TYPE, ENABLE_SSL_SUPPORT, FOR_SCHEMA_UPGRADE, IFS_DOMAIN_DISPLAY_NAME, IFS_DOMAIN_NAME, IFS_SCHEMA_NAME, IFS_SCHEMA_PASSWORD, IFS_SERVICE_NAME, IFS_USER_NAME, IFS_USER_PASSWORD, INCLUDE_PATH, INITIAL_CONTEXT_FACTORY, LDAP_URL_DAS_LOOKUP, LDAP_USER_NAME, LDAP_USER_PASSWORD, OUTPUT_FILE, PARAMETER_FILE, REGISTRY, SCHEMA_VERSION_KEY, SECURITY_PROTOCOL_NAME, SERVICE_CONFIGURATION_NAME`

Constructor Summary
`PrepareAttributeColumns()`

Method Summary
`void` | `addAttributeColumnIfNecessary(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String rdbmsDataType)` Alter the specified table to add a new column in preparation for adding an attribute later that uses it.
`protected java.lang.String` | `getPrimaryKeyColumn()` Return the name of the primary key column.
`protected abstract java.lang.String` | `getSelectConditionSql()` Return the SQL string used as the condition to select rows for update.
`protected java.lang.String` | `getSelectSql()` Return the SQL used to select a batch of rows.
`protected abstract java.lang.String` | `getTableName()` Return the name of the table being updated.
`protected abstract java.lang.String` | `getUpdateColumnsSql()` Return the SQL string used to set new values in the update statement.
`protected java.lang.String` | `getUpdateSql()` Return the SQL used to update each row.
`void` | `initializeAttributeColumns(java.sql.Connection conn, int batchSize)` Initialize the newly added columns by selecting and updating rows in batches.
`protected java.lang.Long[]` | `selectIdBatch(java.sql.Connection conn, long lastId, int batchSize)` Select a batch of IDs for rows that need to be updated.

Methods inherited from class oracle.ifs.admin.upgrade.common.CreateDatabaseObjectsAction
`analyze, analyzeTable, closeResultSet, closeStatement, columnExists, commit, createIndex, createIndex, createIndex, createIndex, createIndex, createIndex, createSequence, createTable, createView, dropIndex, dropSequence, dropTable, dropView, executeStatement, executeUpdate, failed, getNextSequenceValue, getSchemaName, getTimestamp, isValidConnection, log, log, printStackTrace, rollback, rowExists, rowExists, stop, tableExists`

Methods inherited from class oracle.ifs.admin.actions.JDBCAction
`execute, perform, setDatabaseUrl, setPassword, setUser`

Methods inherited from class oracle.ifs.utils.action.AbstractAction
`getDescription, getName, getValue, isContinueOnError, putValue, setDefaultOptions, setDescription, setName, setOptions`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PrepareAttributeColumns

    public PrepareAttributeColumns()

Method Detail

### addAttributeColumnIfNecessary

    public void addAttributeColumnIfNecessary(java.sql.Connection conn,
                                              java.lang.String tableName,
                                              java.lang.String columnName,
                                              java.lang.String rdbmsDataType)
                                       throws java.sql.SQLException

  Description copied from class: `PrepareAttributeColumns`
  Alter the specified table to add a new column in preparation for adding an attribute later that uses it.

  Parameters:
    `conn` - database connection
    `tableName` - the table name for the classobject involved
    `columnName` - the name of the new column to add
    `rdbmsDataType` - the DBMS data type string (e.g. "NUMBER(20)" )
  Throws:
    `java.sql.SQLException` - if the operation fails

### initializeAttributeColumns

    public void initializeAttributeColumns(java.sql.Connection conn,
                                           int batchSize)
                                    throws java.sql.SQLException

  Description copied from class: `PrepareAttributeColumns`
  Initialize the newly added columns by selecting and updating rows in batches.

  The caller must implement the following methods:

  Parameters:
    `conn` - database connection
    `batchSize` - the maximum number of rows to select in each batch
  Throws:
    `java.sql.SQLException` - if the operation fails

### selectIdBatch

    protected java.lang.Long[] selectIdBatch(java.sql.Connection conn,
                                             long lastId,
                                             int batchSize)
                                      throws java.sql.SQLException

  Description copied from class: `PrepareAttributeColumns`
  Select a batch of IDs for rows that need to be updated.

  Parameters:
    `conn` - database connection
    `lastId` - the last ID processed, included in the query to only process IDs greater than this value
    `batchSize` - the maximum number of rows to be selected
  Returns:
    the batch of IDs
  Throws:
    `java.sql.SQLException` - if the operation fails

### getSelectSql

    protected java.lang.String getSelectSql()

  Description copied from class: `PrepareAttributeColumns`
  Return the SQL used to select a batch of rows.

  Returns:
    the SQL string to use for the select

### getUpdateSql

    protected java.lang.String getUpdateSql()

  Description copied from class: `PrepareAttributeColumns`
  Return the SQL used to update each row.

  Returns:
    the SQL string to use for the update

### getPrimaryKeyColumn

    protected java.lang.String getPrimaryKeyColumn()

  Description copied from class: `PrepareAttributeColumns`
  Return the name of the primary key column.

  The implementation here returns "id". Subclasses may override. Must be a column with a data type of NUMBER.

  Returns:
    the name of the NUMBER primary key column

### getTableName

    protected abstract java.lang.String getTableName()

  Description copied from class: `PrepareAttributeColumns`
  Return the name of the table being updated.

  Returns:
    the name of the table being updated

### getSelectConditionSql

    protected abstract java.lang.String getSelectConditionSql()

  Description copied from class: `PrepareAttributeColumns`
  Return the SQL string used as the condition to select rows for update.

  Must not contain any bind variables, and must be a legal SQL boolean expression. If no condition is desired, must return something equivalent to "1 = 1". For example: `"POLICYLISTS is null"`

  Returns:
    the SQL string to use for the select condition

### getUpdateColumnsSql

    protected abstract java.lang.String getUpdateColumnsSql()

  Description copied from class: `PrepareAttributeColumns`
  Return the SQL string used to set new values in the update statement.

  For example: `"POLICYLISTS = 0, STORAGEGROUP = 0"`

  Returns:
    the SQL string to use for assigning new values

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD