|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.modeldiff.IndexInfo
This package private class encapsulates the all the information for one index.
Field Summary | |
private String[] |
columns_
|
private String |
conceptualSize_
|
private boolean |
dropForAlterTableModify_
|
private static String |
DUMMY_INDEX_NAME
Name of dummy index used for normalizing column names. |
private boolean |
hasColumnsThatAreFunctions_
|
private static int |
HASHMAP_INITIAL_CAPACITY
|
private String |
indexDbName_
|
private String |
indexName_
|
private int |
indexType_
|
private Boolean[] |
isExpression_
|
private boolean |
new_
|
private String[] |
nonNormalizedColumns_
|
private static HashMap |
normalizedColumnNameCache_
Storage for the mapping of column names to their normalized column names. |
private boolean |
obsolete_
|
private String |
previousIndexName_
|
private String |
prexistingIndexName_
|
private BaseTableInfo |
tableInfo_
|
private String |
tableName_
|
private String |
tableSpaceName_
|
Constructor Summary | |
(package private) |
IndexInfo()
Used to get access to methods that do not need BaseTableInfo, or that supply the BaseTableInfo. |
(package private) |
IndexInfo(BaseTableInfo tableInfo,
String table_name,
String index_name,
int index_type,
String column)
Create an index on a single column. |
(package private) |
IndexInfo(BaseTableInfo tableInfo,
String table_name,
String index_name,
int index_type,
String[] columns)
Create an index on multiple columns. |
(package private) |
IndexInfo(String table_name,
String index_name,
int index_type)
Create an index from data from the database, not the class model, and set the columns later. |
Method Summary | |
private static String[][] |
cloneColumnNames(String[][] in)
Clones the data structure that holds Column Names. |
(package private) String |
column(int i)
Get the i-th normalized column name used to define this index. |
(package private) int |
columnCount()
Delivers the count of columns, independent of knowing the structure that holds them. |
private boolean |
createDummyIndex(Statement statement,
String column_name)
A dummy index is needed in order to prepare for the uncontrollable, automated re-naming performed by the database. |
private void |
dropDummyIndexSmotheringErrors(Statement statement)
|
(package private) String |
generateCreateDDL()
Produce a create statement for this index. |
(package private) String |
generateDropDDL()
Produce a drop statement for this index. |
(package private) boolean |
getColumnIsAnExpression(int i)
|
(package private) static String[][] |
getComputedIndexColumns(BaseTableInfo tableInfo,
boolean isUnique)
Get the COMPOSITE UNIQUE indices or COMPOSITE NON-UNIQUE indices. |
protected String |
getIndexDbName()
|
protected void |
getIndexDbName(String value_)
|
private String |
getIndexFunctionExpression(String index_name,
int position)
Look up the function expression for columns that are named SYS_NC...##$. |
protected String |
getIndexName()
Accessor for the index's name. |
(package private) int |
getIndexType()
Accessor for the index's type. |
protected boolean |
getNew()
|
protected boolean |
getObsolete()
|
(package private) String |
getPreviousIndexName()
|
private HashMap |
getTableColumnMapCache()
Lookup the map of columnName to normalizedColumnName for the current index's tableName. |
(package private) String |
getTableName()
Accessor for the index's Table name. |
(package private) boolean |
hasColumnsThatAreFunctions()
|
private boolean |
indexesSameInformationAs(IndexInfo other_index)
Tests whether the other index represents the same index on the same table as this one does. |
(package private) boolean |
indexesSameInformationInSameWayAs(IndexInfo other_index)
Note that column names are case insensitive and that the "indexName_" and "tableInfo_" are NOT involved in determining equality. |
protected void |
indexName(int seq)
|
private boolean |
isAnAllowedColumnName(String column_name)
Is the column name just a normal column name (versus a column name generated by the database)? A normal column name has AlphaNumeric(s), maybe "_" characters, and maybe "$" characters. |
(package private) boolean |
isAPrimaryKey()
|
(package private) boolean |
isTheNonNormalizedColumnAFunctionExpression(int position)
|
(package private) boolean |
isTheNonNormalizedColumnNameAFunctionExpression(String non_normalized_column_name)
Is the column name an oracle reference to a function expression? |
(package private) static void |
lookupFbiRelatedDbTriggerNames(HashSet droppedFbiRelatedTriggerNames)
Query the database for names of all triggers that are used to update Function Based Index (FBI) computed columns. |
(package private) void |
markDropForAlterTableModify()
|
(package private) boolean |
markedDropForAlterTableModify()
|
(package private) String |
nonNormalizedColumn(int position)
A table's index is an ordered collection of nonNormalizedColumns. |
private String |
normalizeColumnName(DatabaseMetaData meta_data,
String column_name)
Create a dummy index from the column name and read back the column name on the created index. |
private void |
normalizeColumnNames()
|
(package private) void |
putColumns(Hashtable cols)
Add these columns to the collection of non-Normalized Columns. |
(package private) void |
setConceptualSize(String size)
Change the conceptual size. |
protected void |
setIndexDbName(String index_name)
|
private void |
setName(String index_name)
Ensure that the name is of reasonable length. |
protected void |
setNew(boolean value_)
|
protected void |
setObsolete(boolean value_)
|
(package private) void |
setPreviousIndexName(String x)
|
(package private) void |
setTableSpaceName(String x)
Change the TableSpace name. |
protected void |
shortenNameIfApplicable()
|
String |
toString()
Override public toString() in the java.lang.Object class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static int HASHMAP_INITIAL_CAPACITY
private BaseTableInfo tableInfo_
private String indexName_
private String previousIndexName_
private String tableName_
private String tableSpaceName_
private String conceptualSize_
private String prexistingIndexName_
private int indexType_
private Boolean[] isExpression_
private String[] columns_
private String[] nonNormalizedColumns_
private boolean hasColumnsThatAreFunctions_
private boolean dropForAlterTableModify_
private boolean obsolete_
private boolean new_
private String indexDbName_
private static HashMap normalizedColumnNameCache_
private static final String DUMMY_INDEX_NAME
Constructor Detail |
IndexInfo()
IndexInfo(String table_name, String index_name, int index_type)
table_name
- The table that has the index.index_name
- An index name unique to that table.index_type
- A number that represents the index type.IndexInfo(BaseTableInfo tableInfo, String table_name, String index_name, int index_type, String column) throws CompareSchemaException
tableInfo
- Table information obtained from Target Model introspection.table_name
- The table that has the index.index_name
- An index name unique to that table.index_type
- A number that represents the index type.
CompareSchemaException
- Forwarded from normalizeColumnNames().IndexInfo(BaseTableInfo tableInfo, String table_name, String index_name, int index_type, String[] columns) throws CompareSchemaException
tableInfo
- Table information obtained from Target Model introspection.table_name
- The table that has the index.index_name
- An index name unique to that table.index_type
- A number that represents the index type.columns
- An array of multiple column names.
CompareSchemaException
- Forwarded from normalizeColumnNames().Method Detail |
public String toString()
protected String getIndexName()
String getPreviousIndexName()
void setPreviousIndexName(String x)
String getTableName()
int getIndexType()
void setTableSpaceName(String x)
x
- The new TableSpace name.void setConceptualSize(String size)
size
- The new conceptual size.boolean getColumnIsAnExpression(int i)
String column(int i)
i
- Identify one of the columns in this IndexInfo.
String nonNormalizedColumn(int position)
position
- The index for one column in the column array.
boolean hasColumnsThatAreFunctions()
void markDropForAlterTableModify()
boolean markedDropForAlterTableModify()
int columnCount()
void putColumns(Hashtable cols) throws CompareSchemaException
cols
- The columns that are to be added to the collection.
CompareSchemaException
- If the normalizeColumnNames failed.boolean indexesSameInformationInSameWayAs(IndexInfo other_index)
other_index
- The other index to compare against.
boolean isAPrimaryKey()
String generateCreateDDL()
String generateDropDDL()
static String[][] getComputedIndexColumns(BaseTableInfo tableInfo, boolean isUnique)
tableInfo
- All the definitions for a table.isUnique
- True if results have only uniqueness indices.
static void lookupFbiRelatedDbTriggerNames(HashSet droppedFbiRelatedTriggerNames) throws CompareSchemaException
droppedFbiRelatedTriggerNames
- Adds triggers to this HashSet.
CompareSchemaException
- The original SQLException is in the log.private void setName(String index_name)
index_name
- A potentially new name that is not to long, but is adequately unique.protected void setIndexDbName(String index_name)
protected void indexName(int seq)
protected void shortenNameIfApplicable()
private boolean indexesSameInformationAs(IndexInfo other_index)
other_index
- The other index to compare against.
private HashMap getTableColumnMapCache()
private void normalizeColumnNames() throws CompareSchemaException
CompareSchemaException
private boolean isAnAllowedColumnName(String column_name)
column_name
- Test this column name.
boolean isTheNonNormalizedColumnNameAFunctionExpression(String non_normalized_column_name)
non_normalized_column_name
- The column name.
boolean isTheNonNormalizedColumnAFunctionExpression(int position)
private String getIndexFunctionExpression(String index_name, int position) throws CompareSchemaException
index_name
- The name of an index.position
- The COLUMN_POSITION in the result set.
CompareSchemaException
- A converted SQLException.private String normalizeColumnName(DatabaseMetaData meta_data, String column_name) throws CompareSchemaException
meta_data
- All the meta data.column_name
- One column name.
CompareSchemaException
- A converted SQLException.private void dropDummyIndexSmotheringErrors(Statement statement)
private final boolean createDummyIndex(Statement statement, String column_name) throws SQLException
statement
- The information needed to perform the execution in the database.column_name
- The dummy index's name.
SQLException
- If an error occurred, but not due to an invalid column name.protected void setObsolete(boolean value_)
protected void setNew(boolean value_)
protected void getIndexDbName(String value_)
protected boolean getObsolete()
protected boolean getNew()
protected String getIndexDbName()
private static String[][] cloneColumnNames(String[][] in)
in
- A String[][] structure that contains all the indexes' ColumnNames.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |