Class RelatedTablesExtension
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.related.RelatedTablesCoreExtension
-
- mil.nga.geopackage.extension.related.RelatedTablesExtension
-
public class RelatedTablesExtension extends RelatedTablesCoreExtension
Related Tables extension- Since:
- 3.0.1
- Author:
- jyutzler, osbornb
-
-
Field Summary
-
Fields inherited from class mil.nga.geopackage.extension.related.RelatedTablesCoreExtension
EXTENSION_AUTHOR, EXTENSION_DEFINITION, EXTENSION_NAME, EXTENSION_NAME_NO_AUTHOR
-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Constructor Description RelatedTablesExtension(GeoPackage geoPackage)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countMappings(String table, long id)
Count the number of mappings to the table and idint
countMappingsToBase(String baseTable, long baseId)
Count the number of mappings to the base table and idint
countMappingsToBase(Collection<ExtendedRelation> extendedRelations, long baseId)
Count the number of mappings in the extended relations to the base idint
countMappingsToBase(ExtendedRelation extendedRelation, long baseId)
Count the number of mappings in the extended relation to the base idint
countMappingsToRelated(String relatedTable, long relatedId)
Count the number of mappings to the related table and idint
countMappingsToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId)
Count the number of mappings in the extended relations to the related idint
countMappingsToRelated(ExtendedRelation extendedRelation, long relatedId)
Count the number of mappings in the extended relation to the related idint
deleteMappings(String table, long id)
Delete mappings to the table and idint
deleteMappingsToBase(String baseTable, long baseId)
Delete mappings to the base table and idint
deleteMappingsToBase(Collection<ExtendedRelation> extendedRelations, long baseId)
Delete mappings in the extended relations to the base idint
deleteMappingsToBase(ExtendedRelation extendedRelation, long baseId)
Delete mappings in the extended relation to the base idint
deleteMappingsToRelated(String relatedTable, long relatedId)
Delete mappings to the related table and idint
deleteMappingsToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId)
Delete mappings in the extended relations to the related idint
deleteMappingsToRelated(ExtendedRelation extendedRelation, long relatedId)
Delete mappings in the extended relation to the related idUserMappingDao
getMappingDao(String tableName)
Get a User Mapping DAO from a table nameUserMappingDao
getMappingDao(ExtendedRelation extendedRelation)
Get a User Mapping DAO from an extended relationList<Long>
getMappingsForBase(String tableName, long baseId)
Get the related id mappings for the base idList<Long>
getMappingsForBase(ExtendedRelation extendedRelation, long baseId)
Get the related id mappings for the base idList<Long>
getMappingsForRelated(String tableName, long relatedId)
Get the base id mappings for the related idList<Long>
getMappingsForRelated(ExtendedRelation extendedRelation, long relatedId)
Get the base id mappings for the related idMediaDao
getMediaDao(String tableName)
Get a related media table DAOMediaDao
getMediaDao(ExtendedRelation extendedRelation)
Get a related media table DAOMediaDao
getMediaDao(MediaTable mediaTable)
Get a related media table DAOSimpleAttributesDao
getSimpleAttributesDao(String tableName)
Get a related simple attributes table DAOSimpleAttributesDao
getSimpleAttributesDao(ExtendedRelation extendedRelation)
Get a related simple attributes table DAOSimpleAttributesDao
getSimpleAttributesDao(SimpleAttributesTable simpleAttributesTable)
Get a related simple attributes table DAOUserCustomDao
getUserDao(String tableName)
Get a User Custom DAO from a table nameboolean
hasMapping(String table, long id)
Determine if a mapping to the table and id existsboolean
hasMapping(String tableName, long baseId, long relatedId)
Determine if the base id and related id mapping existsboolean
hasMappingToBase(String baseTable, long baseId)
Determine if a mapping to the base table and id existsboolean
hasMappingToBase(Collection<ExtendedRelation> extendedRelations, long baseId)
Determine if a mapping in the extended relations to the base id existsboolean
hasMappingToBase(ExtendedRelation extendedRelation, long baseId)
Determine if a mapping in the extended relation to the base id existsboolean
hasMappingToRelated(String relatedTable, long relatedId)
Determine if a mapping to the related table and id existsboolean
hasMappingToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId)
Determine if a mapping in the extended relations to the related id existsboolean
hasMappingToRelated(ExtendedRelation extendedRelation, long relatedId)
Determine if a mapping in the extended relation to the related id exists-
Methods inherited from class mil.nga.geopackage.extension.related.RelatedTablesCoreExtension
addAttributesRelationship, addAttributesRelationship, addAttributesRelationship, addAttributesRelationship, addFeaturesRelationship, addFeaturesRelationship, addMediaRelationship, addMediaRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addRelationship, addSimpleAttributesRelationship, addSimpleAttributesRelationship, addTilesRelationship, addTilesRelationship, addTilesRelationship, addTilesRelationship, buildRelationName, createExtendedRelationsTable, createRelatedTable, createUserMappingTable, createUserMappingTable, getBaseTableRelations, getExtendedRelationsDao, getExtendedRelationsDao, getExtendedRelationsDao, getPrimaryKeyColumnName, getRelatedTableRelations, getRelations, getRelations, getRelations, getRelations, getRelationships, getTableRelations, has, has, hasBaseTableRelations, hasRelatedTableRelations, hasRelations, hasRelations, hasRelations, hasRelations, hasTableRelations, removeExtension, removeRelationship, removeRelationship, removeRelationship, removeRelationship, removeRelationships, removeRelationshipsWithMappingTable, setContents
-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, verifyWritable
-
-
-
-
Constructor Detail
-
RelatedTablesExtension
public RelatedTablesExtension(GeoPackage geoPackage)
Constructor- Parameters:
geoPackage
- GeoPackage
-
-
Method Detail
-
getUserDao
public UserCustomDao getUserDao(String tableName)
Get a User Custom DAO from a table name- Parameters:
tableName
- table name- Returns:
- user custom dao
-
getMappingDao
public UserMappingDao getMappingDao(ExtendedRelation extendedRelation)
Get a User Mapping DAO from an extended relation- Parameters:
extendedRelation
- extended relation- Returns:
- user mapping dao
-
getMappingDao
public UserMappingDao getMappingDao(String tableName)
Get a User Mapping DAO from a table name- Parameters:
tableName
- mapping table name- Returns:
- user mapping dao
-
getMediaDao
public MediaDao getMediaDao(MediaTable mediaTable)
Get a related media table DAO- Parameters:
mediaTable
- media table- Returns:
- media DAO
-
getMediaDao
public MediaDao getMediaDao(ExtendedRelation extendedRelation)
Get a related media table DAO- Parameters:
extendedRelation
- extended relation- Returns:
- media DAO
-
getMediaDao
public MediaDao getMediaDao(String tableName)
Get a related media table DAO- Parameters:
tableName
- media table name- Returns:
- media DAO
-
getSimpleAttributesDao
public SimpleAttributesDao getSimpleAttributesDao(SimpleAttributesTable simpleAttributesTable)
Get a related simple attributes table DAO- Parameters:
simpleAttributesTable
- simple attributes table- Returns:
- simple attributes DAO
-
getSimpleAttributesDao
public SimpleAttributesDao getSimpleAttributesDao(ExtendedRelation extendedRelation)
Get a related simple attributes table DAO- Parameters:
extendedRelation
- extended relation- Returns:
- simple attributes DAO
-
getSimpleAttributesDao
public SimpleAttributesDao getSimpleAttributesDao(String tableName)
Get a related simple attributes table DAO- Parameters:
tableName
- simple attributes table name- Returns:
- simple attributes DAO
-
getMappingsForBase
public List<Long> getMappingsForBase(ExtendedRelation extendedRelation, long baseId)
Get the related id mappings for the base id- Parameters:
extendedRelation
- extended relationbaseId
- base id- Returns:
- IDs representing the matching related IDs
-
getMappingsForBase
public List<Long> getMappingsForBase(String tableName, long baseId)
Get the related id mappings for the base id- Parameters:
tableName
- mapping table namebaseId
- base id- Returns:
- IDs representing the matching related IDs
-
getMappingsForRelated
public List<Long> getMappingsForRelated(ExtendedRelation extendedRelation, long relatedId)
Get the base id mappings for the related id- Parameters:
extendedRelation
- extended relationrelatedId
- related id- Returns:
- IDs representing the matching base IDs
-
getMappingsForRelated
public List<Long> getMappingsForRelated(String tableName, long relatedId)
Get the base id mappings for the related id- Parameters:
tableName
- mapping table namerelatedId
- related id- Returns:
- IDs representing the matching base IDs
-
hasMapping
public boolean hasMapping(String tableName, long baseId, long relatedId)
Determine if the base id and related id mapping exists- Parameters:
tableName
- mapping table namebaseId
- base idrelatedId
- related id- Returns:
- true if mapping exists
- Since:
- 3.2.0
-
countMappingsToBase
public int countMappingsToBase(String baseTable, long baseId) throws SQLException
Count the number of mappings to the base table and id- Parameters:
baseTable
- base table namebaseId
- base id- Returns:
- mappings count
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasMappingToBase
public boolean hasMappingToBase(String baseTable, long baseId) throws SQLException
Determine if a mapping to the base table and id exists- Parameters:
baseTable
- base table namebaseId
- base id- Returns:
- true if mapping exists
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
countMappingsToBase
public int countMappingsToBase(Collection<ExtendedRelation> extendedRelations, long baseId)
Count the number of mappings in the extended relations to the base id- Parameters:
extendedRelations
- extended relationsbaseId
- base id- Returns:
- mappings count
- Since:
- 6.3.0
-
hasMappingToBase
public boolean hasMappingToBase(Collection<ExtendedRelation> extendedRelations, long baseId)
Determine if a mapping in the extended relations to the base id exists- Parameters:
extendedRelations
- extended relationsbaseId
- base id- Returns:
- true if mapping exists
- Since:
- 6.3.0
-
countMappingsToBase
public int countMappingsToBase(ExtendedRelation extendedRelation, long baseId)
Count the number of mappings in the extended relation to the base id- Parameters:
extendedRelation
- extended relationbaseId
- base id- Returns:
- mappings count
- Since:
- 6.3.0
-
hasMappingToBase
public boolean hasMappingToBase(ExtendedRelation extendedRelation, long baseId)
Determine if a mapping in the extended relation to the base id exists- Parameters:
extendedRelation
- extended relationbaseId
- base id- Returns:
- true if mapping exists
- Since:
- 6.3.0
-
deleteMappingsToBase
public int deleteMappingsToBase(String baseTable, long baseId) throws SQLException
Delete mappings to the base table and id- Parameters:
baseTable
- base table namebaseId
- base id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
deleteMappingsToBase
public int deleteMappingsToBase(Collection<ExtendedRelation> extendedRelations, long baseId) throws SQLException
Delete mappings in the extended relations to the base id- Parameters:
extendedRelations
- extended relationsbaseId
- base id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
deleteMappingsToBase
public int deleteMappingsToBase(ExtendedRelation extendedRelation, long baseId) throws SQLException
Delete mappings in the extended relation to the base id- Parameters:
extendedRelation
- extended relationbaseId
- base id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
countMappingsToRelated
public int countMappingsToRelated(String relatedTable, long relatedId) throws SQLException
Count the number of mappings to the related table and id- Parameters:
relatedTable
- related table namerelatedId
- related id- Returns:
- mappings count
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasMappingToRelated
public boolean hasMappingToRelated(String relatedTable, long relatedId) throws SQLException
Determine if a mapping to the related table and id exists- Parameters:
relatedTable
- related table namerelatedId
- related id- Returns:
- true if mapping exists
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
countMappingsToRelated
public int countMappingsToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId)
Count the number of mappings in the extended relations to the related id- Parameters:
extendedRelations
- extended relationsrelatedId
- related id- Returns:
- mappings count
- Since:
- 6.3.0
-
hasMappingToRelated
public boolean hasMappingToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId)
Determine if a mapping in the extended relations to the related id exists- Parameters:
extendedRelations
- extended relationsrelatedId
- related id- Returns:
- true if mapping exists
- Since:
- 6.3.0
-
countMappingsToRelated
public int countMappingsToRelated(ExtendedRelation extendedRelation, long relatedId)
Count the number of mappings in the extended relation to the related id- Parameters:
extendedRelation
- extended relationrelatedId
- related id- Returns:
- mappings count
- Since:
- 6.3.0
-
hasMappingToRelated
public boolean hasMappingToRelated(ExtendedRelation extendedRelation, long relatedId)
Determine if a mapping in the extended relation to the related id exists- Parameters:
extendedRelation
- extended relationrelatedId
- related id- Returns:
- true if mapping exists
- Since:
- 6.3.0
-
deleteMappingsToRelated
public int deleteMappingsToRelated(String relatedTable, long relatedId) throws SQLException
Delete mappings to the related table and id- Parameters:
relatedTable
- related table namerelatedId
- related id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
deleteMappingsToRelated
public int deleteMappingsToRelated(Collection<ExtendedRelation> extendedRelations, long relatedId) throws SQLException
Delete mappings in the extended relations to the related id- Parameters:
extendedRelations
- extended relationsrelatedId
- related id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
deleteMappingsToRelated
public int deleteMappingsToRelated(ExtendedRelation extendedRelation, long relatedId) throws SQLException
Delete mappings in the extended relation to the related id- Parameters:
extendedRelation
- extended relationrelatedId
- related id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
countMappings
public int countMappings(String table, long id) throws SQLException
Count the number of mappings to the table and id- Parameters:
table
- table nameid
- table id- Returns:
- mappings count
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasMapping
public boolean hasMapping(String table, long id) throws SQLException
Determine if a mapping to the table and id exists- Parameters:
table
- table nameid
- table id- Returns:
- true if mapping exists
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
deleteMappings
public int deleteMappings(String table, long id) throws SQLException
Delete mappings to the table and id- Parameters:
table
- table nameid
- table id- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
-