public class ObjectIndexUtilities extends Object
Constructor and Description |
---|
ObjectIndexUtilities() |
Modifier and Type | Method and Description |
---|---|
protected static void |
closeResultSet(ResultSet rset)
Try our best to close a resultSet; no exceptions thrown
|
protected static void |
closeStatement(Statement stmt)
Try our best to close a Statement; no exceptions thrown
|
static void |
createIndex(Connection con,
String tableSuffix,
String column)
Creates an index on an iFS classobject attribute.
|
static void |
dropIndex(Connection con,
String tableSuffix,
String column)
Drops an index on an iFS classobject attribute.
|
static String |
getIndexOnObjectAttribute(Statement stmt,
String tableSuffix,
String column)
Returns the name of an index on an attribute of an object.
|
static Long |
getObjectId(Statement stmt,
String tableSuffix,
String column)
Get the Object ID for the Attribute of the specified
table suffix and column.
|
static void |
updateIndexedAttribute(LibrarySession session,
String className,
String attrName,
boolean newIsIndexedValue)
updateIndexedAttribute should be invoked after creating a new index
on an attribute.
|
public static void createIndex(Connection con, String tableSuffix, String column) throws SQLException
con
- the JDBC connection to use for executing the query.tableSuffix
- the suffix of the table the index is on; for example
"document" for the odm_document tablecolumn
- the column for the attributeSQLException
- if a database error occurs.public static void dropIndex(Connection con, String tableSuffix, String column) throws SQLException
con
- the JDBC connection to use for executing the query.tableSuffix
- the suffix of the table the index is on; for example
"document" for the odm_document tablecolumn
- the column for the attributeSQLException
- if a database error occurs.public static Long getObjectId(Statement stmt, String tableSuffix, String column) throws SQLException
stmt
- the JDBC statement to use for executing the query.tableSuffix
- the suffix of the table the index is on; for example
"document" for the odm_document tablecolumn
- the column for the attributeSQLException
- if a database error occurs or if there is
no column for the specified table suffix.public static String getIndexOnObjectAttribute(Statement stmt, String tableSuffix, String column) throws SQLException
SELECT DISTINCT index_name FROM user_ind_columns x
WHERE table_name = 'ODM_tableSuffix.toUpperCase()'
AND column_name = 'column.toUpperCase()'
AND 1 = (SELECT count(*) FROM user_ind_columns y
WHERE y.table_name = 'ODM_tableSuffix.toUpperCase()'
AND y.index_name = x.index_name)
stmt
- the Statement to use for executing the query.tableSuffix
- the suffix of the table the index is on; for example
"document" for the odm_document tablecolumn
- the column the index is on.SQLException
- if a database error occurs.protected static void closeResultSet(ResultSet rset)
rset
- the ResultSetprotected static void closeStatement(Statement stmt)
stmt
- the Statementpublic static void updateIndexedAttribute(LibrarySession session, String className, String attrName, boolean newIsIndexedValue) throws IfsException
session
- the current LibrarySessionclassName
- the class name of the ClassObjectattrName
- the attribute of the ClassObjectnewIsIndexedValue
- new boolean setting for Indexed attributeIfsException
- if the operation failsCopyright © 2023. All rights reserved.