Class MetaDataImpl
java.lang.Object
ch.tocco.nice2.model.entity.impl.schema.meta.MetaDataImpl
- All Implemented Interfaces:
MetaData
-
Nested Class Summary
Nested classes/interfaces inherited from interface MetaData
MetaData.ForeignKeyInfo, MetaData.IndexInfo -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetaDataImpl(String dsName, boolean isDefault, DataSource dataSource) MetaDataImpl(String dsName, boolean isDefault, DataSource dataSource, Optional<Connection> conn) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends V>
TvoidbooleanfindColumns(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 thesourcetable that references primary or unique keys in thetargettable.inthashCode()booleantoString()useConnection(Connection conn) Use the given connection for all database accesses instead of obtaining new ones from the data source.
-
Field Details
-
values
-
-
Constructor Details
-
MetaDataImpl
public MetaDataImpl(String dsName, boolean isDefault, DataSource dataSource, Optional<Connection> conn) -
MetaDataImpl
-
-
Method Details
-
useConnection
Description copied from interface:MetaDataUse the given connection for all database accesses instead of obtaining new ones from the data source.- Specified by:
useConnectionin interfaceMetaData
-
getDataSourceName
- Specified by:
getDataSourceNamein interfaceMetaData
-
getDataSource
- Specified by:
getDataSourcein interfaceMetaData
-
getSchemaName
- Specified by:
getSchemaNamein interfaceMetaData
-
isDefault
-
clearCache
public void clearCache()- Specified by:
clearCachein interfaceMetaData
-
getTables
-
getForeignKeyInfo
public Iterable<MetaData.ForeignKeyInfo> getForeignKeyInfo(TableMetaData source, TableMetaData target) Description copied from interface:MetaDataReturns all foreign key information from thesourcetable that references primary or unique keys in thetargettable. Most often, this will contain one item or is empty, as there are usually not more than one reference from one table to another.- Specified by:
getForeignKeyInfoin interfaceMetaData
-
getForeignKeyInfo
Description copied from interface:MetaDataFinds 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).- Specified by:
getForeignKeyInfoin interfaceMetaData
-
forEntity
Description copied from interface:MetaDataFinds a table corresponding to the given entity model. -
forTable
-
forRelation
Description copied from interface:MetaDataFinds the link table for the given n:m relation model.- Specified by:
forRelationin interfaceMetaData
-
findColumns
Description copied from interface:MetaDataFinds the foreign key columns for the given 1:n relation model.- Specified by:
findColumnsin interfaceMetaData
-
equals
-
hashCode
-
toString
-
cachedGet
-