public class DatabaseMetaDataReaderImpl extends Object implements DatabaseMetaDataReader
Constructor and Description |
---|
DatabaseMetaDataReaderImpl(DatabaseProvider databaseProvider,
NameConverters nameConverters,
SchemaConfiguration schemaConfiguration) |
Modifier and Type | Method and Description |
---|---|
Iterable<? extends Field> |
getFields(DatabaseMetaData databaseMetaData,
String tableName) |
Iterable<ForeignKey> |
getForeignKeys(DatabaseMetaData metaData,
String tableName)
Gets the list of foreign keys for a given table
|
Iterable<? extends Index> |
getIndexes(DatabaseMetaData databaseMetaData,
String tableName)
Gets the list of simple indexes for a given table.
|
Iterable<String> |
getTableNames(DatabaseMetaData metaData)
Gets the names of the existing tables in the DB
|
boolean |
isTablePresent(DatabaseMetaData databaseMetaData,
Class<? extends RawEntity<?>> type)
Checks if the table corresponding to given type exists in the database.
|
public DatabaseMetaDataReaderImpl(DatabaseProvider databaseProvider, NameConverters nameConverters, SchemaConfiguration schemaConfiguration)
public boolean isTablePresent(DatabaseMetaData databaseMetaData, Class<? extends RawEntity<?>> type)
DatabaseMetaDataReader
isTablePresent
in interface DatabaseMetaDataReader
databaseMetaData
- of the database to be checkedtype
- to check againstpublic Iterable<String> getTableNames(DatabaseMetaData metaData)
DatabaseMetaDataReader
getTableNames
in interface DatabaseMetaDataReader
metaData
- the meta data from which to extract the table namesIterable
of table names as strings
public Iterable<? extends Field> getFields(DatabaseMetaData databaseMetaData, String tableName)
getFields
in interface DatabaseMetaDataReader
public Iterable<? extends Index> getIndexes(DatabaseMetaData databaseMetaData, String tableName)
DatabaseMetaDataReader
getIndexes
in interface DatabaseMetaDataReader
databaseMetaData
- the database metadata to read the information fromtableName
- the name of the table from which to read the indexesIterable
of simple indexespublic Iterable<ForeignKey> getForeignKeys(DatabaseMetaData metaData, String tableName)
DatabaseMetaDataReader
getForeignKeys
in interface DatabaseMetaDataReader
metaData
- the database metadata to read the information fromtableName
- the name of the table from which to read the foreign keysIterable
of foreign keysCopyright © 2007–2022 Atlassian. All rights reserved.