|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.common.impex.util.ExtractionUtils
public class ExtractionUtils
The following class contains methods used for schema extraction with java.sql.DatabaseMetaData
Field Summary | |
---|---|
protected static int |
COLUMN_DEFAULT_INDEX
|
protected static int |
COLUMN_NAME_INDEX
|
protected static int |
COLUMN_NULLABLE_INDEX
|
protected static int |
COLUMN_REMARKS_INDEX
|
protected static String |
COLUMN_RESULT_SET_NULLABLE_VALUE
|
protected static int |
COLUMN_TYPE_INDEX
|
protected static int |
COLUMN_TYPE_SCALE_INDEX
|
protected static int |
COLUMN_TYPE_SIZE_INDEX
|
protected static ForeignKeyConstraintType |
DEFAULT_CONSTRAINT_RULE
|
protected static boolean |
DEFAULT_NULLABLE
|
protected static int |
FOREIGN_KEY_IMPORTED_COLUMN_NAME_INDEX
|
protected static int |
FOREIGN_KEY_IMPORTED_TABLE_NAME_INDEX
|
protected static int |
FOREIGN_KEY_LOCAL_COLUMN_NAME_INDEX
|
protected static int |
FOREIGN_KEY_NAME_INDEX
|
protected static int |
FOREIGN_KEY_ON_DELETE_INDEX
|
protected static int |
FOREIGN_KEY_ON_UPDATE_INDEX
|
protected static List<String> |
IGNORED_TABLE_NAME_PREFIXES
|
protected static int |
INDEX_COLUMN_NAME_INDEX
|
protected static int |
INDEX_NAME_INDEX
|
protected static int |
INDEX_NON_UNIQUE_INDEX
|
protected static String |
ORACLE_RECYCLE_BIN_TABLE_NAME_PREFIX
Oracle creates tables with a prefix of "BIN$" to represent a recently deleted table (a 'recycle bin' of sorts), introduced in Oracle 10 See this article for details: http://docs.oracle.com/cd/B19306_01/server.102/b14231/tables.htm#ADMIN01511 |
protected static int |
PRIMARY_KEY_COLUMN_NAME_INDEX
|
protected static int |
PRIMARY_KEY_NAME_INDEX
|
protected static String |
PRIMARY_KEY_UNNAMED_KEY
|
protected static String |
SINGLE_QUOTE
|
protected static Map<Integer,DataType> |
SQL_TYPE_TO_DATA_TYPE
|
protected static int |
TABLE_COMMENT_INDEX
|
protected static String |
TABLE_META_DATA_TYPE
|
protected static int |
TABLE_NAME_INDEX
|
Constructor Summary | |
---|---|
ExtractionUtils()
|
Method Summary | |
---|---|
static void |
addOrUpdateForeignKeys(ResultSet rs,
Map<String,ForeignKey> foreignKeys,
String tableName)
|
static List<ForeignKey> |
extractForeignKeys(DatabaseMetaData meta,
String schema,
List<String> tables,
org.kuali.common.util.PercentCompleteInformer informer)
|
static List<Column> |
extractTableColumns(String tableName,
String schemaName,
DatabaseMetaData databaseMetaData)
|
static String |
extractTableComment(String tableName,
String schemaName,
DatabaseMetaData databaseMetaData)
|
static List<Index> |
extractTableIndices(String tableName,
String schemaName,
DatabaseMetaData databaseMetaData)
This method extracts raw index information for a table. |
static Map<String,List<String>> |
extractTablePrimaryKeyColumns(String tableName,
String schemaName,
DatabaseMetaData databaseMetaData)
|
protected static Map<Integer,DataType> |
getDataTypeMapping()
|
static List<String> |
getNamedPrimaryKeyColumns(Map<String,List<String>> primaryKeyData)
Returns the first list of primary key columns found in the primary key data that does not have an "unnamed" primary key name. |
static String |
getPrimaryKeyName(Map<String,List<String>> primaryKeyData)
Returns the first primary key name found in the primary key data that does not have an "unnamed" primary key name. |
static List<String> |
getTableNames(DataSource dataSource,
String schema)
|
static List<String> |
getTableNamesFromMetaData(String schema,
DatabaseMetaData meta)
|
static List<String> |
getTableNamesFromMetaDataUsingIgnorePrefixes(String schemaName,
DatabaseMetaData databaseMetaData)
|
static DataTypeSize |
translateExtractedTypeSize(Integer typeSize,
Integer typeSizeScale)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String TABLE_META_DATA_TYPE
protected static final int TABLE_NAME_INDEX
protected static final int TABLE_COMMENT_INDEX
protected static final int COLUMN_NAME_INDEX
protected static final int COLUMN_TYPE_INDEX
protected static final int COLUMN_TYPE_SIZE_INDEX
protected static final int COLUMN_TYPE_SCALE_INDEX
protected static final int COLUMN_REMARKS_INDEX
protected static final int COLUMN_DEFAULT_INDEX
protected static final int COLUMN_NULLABLE_INDEX
protected static final String COLUMN_RESULT_SET_NULLABLE_VALUE
protected static final int PRIMARY_KEY_COLUMN_NAME_INDEX
protected static final int PRIMARY_KEY_NAME_INDEX
protected static final String PRIMARY_KEY_UNNAMED_KEY
protected static final int INDEX_NON_UNIQUE_INDEX
protected static final int INDEX_NAME_INDEX
protected static final int INDEX_COLUMN_NAME_INDEX
protected static final int FOREIGN_KEY_IMPORTED_TABLE_NAME_INDEX
protected static final int FOREIGN_KEY_IMPORTED_COLUMN_NAME_INDEX
protected static final int FOREIGN_KEY_LOCAL_COLUMN_NAME_INDEX
protected static final int FOREIGN_KEY_ON_UPDATE_INDEX
protected static final int FOREIGN_KEY_ON_DELETE_INDEX
protected static final int FOREIGN_KEY_NAME_INDEX
protected static final Map<Integer,DataType> SQL_TYPE_TO_DATA_TYPE
protected static final String ORACLE_RECYCLE_BIN_TABLE_NAME_PREFIX
protected static final List<String> IGNORED_TABLE_NAME_PREFIXES
protected static final String SINGLE_QUOTE
protected static final boolean DEFAULT_NULLABLE
protected static final ForeignKeyConstraintType DEFAULT_CONSTRAINT_RULE
Constructor Detail |
---|
public ExtractionUtils()
Method Detail |
---|
protected static Map<Integer,DataType> getDataTypeMapping()
public static List<String> getTableNames(DataSource dataSource, String schema) throws SQLException
SQLException
public static List<String> getTableNamesFromMetaDataUsingIgnorePrefixes(String schemaName, DatabaseMetaData databaseMetaData) throws SQLException
SQLException
public static List<String> getTableNamesFromMetaData(String schema, DatabaseMetaData meta) throws SQLException
SQLException
public static String extractTableComment(String tableName, String schemaName, DatabaseMetaData databaseMetaData) throws SQLException
SQLException
public static List<Column> extractTableColumns(String tableName, String schemaName, DatabaseMetaData databaseMetaData) throws SQLException
SQLException
public static DataTypeSize translateExtractedTypeSize(Integer typeSize, Integer typeSizeScale)
public static Map<String,List<String>> extractTablePrimaryKeyColumns(String tableName, String schemaName, DatabaseMetaData databaseMetaData) throws SQLException
SQLException
public static List<String> getNamedPrimaryKeyColumns(Map<String,List<String>> primaryKeyData)
primaryKeyData
- a Map assumed to be the result of calling extractPrimaryKeyColumns
public static String getPrimaryKeyName(Map<String,List<String>> primaryKeyData)
primaryKeyData
- a Map assumed to be the result of calling extractPrimaryKeyColumns
public static List<Index> extractTableIndices(String tableName, String schemaName, DatabaseMetaData databaseMetaData) throws SQLException
tableName
- Name of the tableschemaName
- Name of the schemadatabaseMetaData
- Connection to the database metadata
SQLException
public static List<ForeignKey> extractForeignKeys(DatabaseMetaData meta, String schema, List<String> tables, org.kuali.common.util.PercentCompleteInformer informer) throws SQLException
SQLException
public static void addOrUpdateForeignKeys(ResultSet rs, Map<String,ForeignKey> foreignKeys, String tableName) throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |