Interface MetaData
- All Known Implementing Classes:
MetaDataImpl
public interface MetaData
Access jdbc metadata associated to a connection's database. The data is
fetched lazily and cached in memory. You may call
clearCache()
to invalidate all cache entries.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
findColumns
(RelationModel relationModel) Finds the foreign key columns for the given 1:n relation model.forEntity
(EntityModel model) Finds a table corresponding to the given entity model.forRelation
(RelationModel relationModel) Finds the link table for the given n:m relation model.Finds a table with the given tablename.getForeignKeyInfo
(RelationModel model) Finds the foreign key information at the database for the given relation model.getForeignKeyInfo
(TableMetaData source, TableMetaData target) Returns all foreign key information from thesource
table that references primary or unique keys in thetarget
table.@Nullable String
boolean
useConnection
(Connection conn) Use the given connection for all database accesses instead of obtaining new ones from the data source.
-
Method Details
-
useConnection
Use the given connection for all database accesses instead of obtaining new ones from the data source. -
getTables
Iterable<TableMetaData> getTables() -
getForeignKeyInfo
Returns all foreign key information from thesource
table that references primary or unique keys in thetarget
table. Most often, this will contain one item or is empty, as there are usually not more than one reference from one table to another. -
getForeignKeyInfo
Finds the foreign key information at the database for the given relation model. If this is a many-to-many relation, there are two foreign key infos returned, where the foreignkey is always the same link table and the primary key either the target or source table of the relation. If this is a many-to-one relation, there is only one foreign key info returned, where the foreign key is the one-side (source) of the relation and the primary key the many side (target). -
forEntity
Finds a table corresponding to the given entity model. -
forTable
Finds a table with the given tablename. -
forRelation
Finds the link table for the given n:m relation model. -
findColumns
Finds the foreign key columns for the given 1:n relation model. -
getDataSourceName
String getDataSourceName() -
getDataSource
DataSource getDataSource() -
getSchemaName
-
isDefault
boolean isDefault() -
clearCache
void clearCache()
-