Class RelatedTablesCoreExtension
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.related.RelatedTablesCoreExtension
-
public abstract class RelatedTablesCoreExtension extends BaseExtension
Related Tables core extension- Since:
- 3.0.1
- Author:
- jyutzler, osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXTENSION_AUTHOR
Extension authorstatic String
EXTENSION_DEFINITION
Extension definition URLstatic String
EXTENSION_NAME
Extension, with author and namestatic String
EXTENSION_NAME_NO_AUTHOR
Extension name without the author-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RelatedTablesCoreExtension(GeoPackageCore geoPackage)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtendedRelation
addAttributesRelationship(String baseTableName, String relatedAttributesTableName, String mappingTableName)
Adds an attributes relationship between the base table and related attributes table.ExtendedRelation
addAttributesRelationship(String baseTableName, String relatedAttributesTableName, UserMappingTable userMappingTable)
Adds an attributes relationship between the base table and related attributes table.ExtendedRelation
addAttributesRelationship(String baseTableName, AttributesTable attributesTable, String mappingTableName)
Adds an attributes relationship between the base table and user attributes related table.ExtendedRelation
addAttributesRelationship(String baseTableName, AttributesTable attributesTable, UserMappingTable userMappingTable)
Adds an attributes relationship between the base table and user attributes related table.ExtendedRelation
addFeaturesRelationship(String baseFeaturesTableName, String relatedFeaturesTableName, String mappingTableName)
Adds a features relationship between the base feature and related feature table.ExtendedRelation
addFeaturesRelationship(String baseFeaturesTableName, String relatedFeaturesTableName, UserMappingTable userMappingTable)
Adds a features relationship between the base feature and related feature table.ExtendedRelation
addMediaRelationship(String baseTableName, MediaTable mediaTable, String mappingTableName)
Adds a media relationship between the base table and user media related table.ExtendedRelation
addMediaRelationship(String baseTableName, MediaTable mediaTable, UserMappingTable userMappingTable)
Adds a media relationship between the base table and user media related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, String mappingTableName, String relationName)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, String mappingTableName, String relationAuthor, String relationName)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, String mappingTableName, RelationType relationType)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, String relationName)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, String relationAuthor, String relationName)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, RelationType relationType)
Adds a relationship between the base and related table.ExtendedRelation
addRelationship(String baseTableName, UserRelatedTable relatedTable, String mappingTableName)
Adds a relationship between the base and user related table.ExtendedRelation
addRelationship(String baseTableName, UserRelatedTable relatedTable, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table.ExtendedRelation
addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String mappingTableName)
Adds a relationship between the base and user related table.ExtendedRelation
addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String relationName, String mappingTableName)
Adds a relationship between the base and user related table.ExtendedRelation
addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String relationName, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table.ExtendedRelation
addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table.ExtendedRelation
addSimpleAttributesRelationship(String baseTableName, SimpleAttributesTable simpleAttributesTable, String mappingTableName)
Adds a simple attributes relationship between the base table and user simple attributes related table.ExtendedRelation
addSimpleAttributesRelationship(String baseTableName, SimpleAttributesTable simpleAttributesTable, UserMappingTable userMappingTable)
Adds a simple attributes relationship between the base table and user simple attributes related table.ExtendedRelation
addTilesRelationship(String baseTableName, String relatedTilesTableName, String mappingTableName)
Adds a tiles relationship between the base table and related tiles table.ExtendedRelation
addTilesRelationship(String baseTableName, String relatedTilesTableName, UserMappingTable userMappingTable)
Adds a tiles relationship between the base table and related tiles table.ExtendedRelation
addTilesRelationship(String baseTableName, TileTable tileTable, String mappingTableName)
Adds a tiles relationship between the base table and user tiles related table.ExtendedRelation
addTilesRelationship(String baseTableName, TileTable tileTable, UserMappingTable userMappingTable)
Adds a tiles relationship between the base table and user tiles related table.String
buildRelationName(String author, String name)
Build the custom relation name with authorboolean
createExtendedRelationsTable()
Create the Extended Relations Table if it does not existboolean
createRelatedTable(UserTable<? extends UserColumn> relatedTable)
Create a user related table if it does not exist.boolean
createUserMappingTable(String mappingTableName)
Create a default user mapping table and extension row if either does not exist.boolean
createUserMappingTable(UserMappingTable userMappingTable)
Create a user mapping table and extension row if either does not exist.List<ExtendedRelation>
getBaseTableRelations(String baseTable)
Get the relations to the base tableExtendedRelationsDao
getExtendedRelationsDao()
Get a Extended Relations DAOstatic ExtendedRelationsDao
getExtendedRelationsDao(GeoPackageCoreConnection db)
Get a Extended Relations DAOstatic ExtendedRelationsDao
getExtendedRelationsDao(GeoPackageCore geoPackage)
Get a Extended Relations DAOString
getPrimaryKeyColumnName(String tableName)
Get the primary key of a tableList<ExtendedRelation>
getRelatedTableRelations(String relatedTable)
Get the relations to the related tableList<ExtendedRelation>
getRelations(String baseTable, String relatedTable)
Get the relations to the base table and related tableList<ExtendedRelation>
getRelations(String baseTable, String relatedTable, String mappingTable)
Get the relations matching the non null provided valuesList<ExtendedRelation>
getRelations(String baseTable, String relatedTable, String relation, String mappingTable)
Get the relations matching the non null provided valuesList<ExtendedRelation>
getRelations(String baseTable, String baseColumn, String relatedTable, String relatedColumn, String relation, String mappingTable)
Get the relations matching the non null provided valuesList<ExtendedRelation>
getRelationships()
Returns the relationships defined through this extensionList<ExtendedRelation>
getTableRelations(String table)
Get the relations to the tableboolean
has()
Determine if the GeoPackage has the extensionboolean
has(String mappingTable)
Determine if the GeoPackage has the extension for the mapping tableboolean
hasBaseTableRelations(String baseTable)
Determine if there are relations to the base tableboolean
hasRelatedTableRelations(String relatedTable)
Determine if there are relations to the related tableboolean
hasRelations(String baseTable, String relatedTable)
Determine if has one or more relations matching the base table and related tableboolean
hasRelations(String baseTable, String relatedTable, String mappingTable)
Determine if has one or more relations matching the non null provided valuesboolean
hasRelations(String baseTable, String relatedTable, String relation, String mappingTable)
Determine if has one or more relations matching the non null provided valuesboolean
hasRelations(String baseTable, String baseColumn, String relatedTable, String relatedColumn, String relation, String mappingTable)
Determine if has one or more relations matching the non null provided valuesboolean
hasTableRelations(String table)
Determine if there are relations to the tablevoid
removeExtension()
Remove all trace of the extensionvoid
removeRelationship(String baseTableName, String relatedTableName, String relationName)
Remove a specific relationship from the GeoPackagevoid
removeRelationship(String baseTableName, String relatedTableName, String relationAuthor, String relationName)
Remove a specific relationship from the GeoPackagevoid
removeRelationship(String baseTableName, String relatedTableName, RelationType relationType)
Remove a specific relationship from the GeoPackagevoid
removeRelationship(ExtendedRelation extendedRelation)
Remove a specific relationship from the GeoPackagevoid
removeRelationships(String table)
Remove all relationships that include the tablevoid
removeRelationshipsWithMappingTable(String mappingTable)
Remove all relationships with the mapping tablevoid
setContents(UserTable<? extends UserColumn> table)
Set the contents in the user table-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, verifyWritable
-
-
-
-
Field Detail
-
EXTENSION_AUTHOR
public static final String EXTENSION_AUTHOR
Extension author- See Also:
- Constant Field Values
-
EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
Extension name without the author- See Also:
- Constant Field Values
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension, with author and name
-
EXTENSION_DEFINITION
public static final String EXTENSION_DEFINITION
Extension definition URL
-
-
Constructor Detail
-
RelatedTablesCoreExtension
protected RelatedTablesCoreExtension(GeoPackageCore geoPackage)
Constructor- Parameters:
geoPackage
- GeoPackage
-
-
Method Detail
-
has
public boolean has()
Determine if the GeoPackage has the extension- Returns:
- true if has extension
-
has
public boolean has(String mappingTable)
Determine if the GeoPackage has the extension for the mapping table- Overrides:
has
in classBaseExtension
- Parameters:
mappingTable
- mapping table name- Returns:
- true if has extension
-
getExtendedRelationsDao
public ExtendedRelationsDao getExtendedRelationsDao()
Get a Extended Relations DAO- Returns:
- extended relations dao
-
getExtendedRelationsDao
public static ExtendedRelationsDao getExtendedRelationsDao(GeoPackageCore geoPackage)
Get a Extended Relations DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- extended relations dao
- Since:
- 4.0.0
-
getExtendedRelationsDao
public static ExtendedRelationsDao getExtendedRelationsDao(GeoPackageCoreConnection db)
Get a Extended Relations DAO- Parameters:
db
- database connection- Returns:
- extended relations dao
- Since:
- 4.0.0
-
createExtendedRelationsTable
public boolean createExtendedRelationsTable()
Create the Extended Relations Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
getPrimaryKeyColumnName
public String getPrimaryKeyColumnName(String tableName)
Get the primary key of a table- Parameters:
tableName
- table name- Returns:
- the column name
-
setContents
public void setContents(UserTable<? extends UserColumn> table)
Set the contents in the user table- Parameters:
table
- user table
-
getRelationships
public List<ExtendedRelation> getRelationships()
Returns the relationships defined through this extension- Returns:
- a list of ExtendedRelation objects
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, String mappingTableName, RelationType relationType)
Adds a relationship between the base and related table. Creates a default user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table namemappingTableName
- mapping table namerelationType
- relation type- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, String mappingTableName, String relationAuthor, String relationName)
Adds a relationship between the base and related table. Creates a default user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table namemappingTableName
- mapping table namerelationAuthor
- relation authorrelationName
- relation name- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, String mappingTableName, String relationName)
Adds a relationship between the base and related table. Creates a default user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table namemappingTableName
- mapping table namerelationName
- relation name- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, RelationType relationType)
Adds a relationship between the base and related table. Creates the user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table nameuserMappingTable
- user mapping tablerelationType
- relation type- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, String relationAuthor, String relationName)
Adds a relationship between the base and related table. Creates the user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table nameuserMappingTable
- user mapping tablerelationAuthor
- relation authorrelationName
- relation name- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, String relatedTableName, UserMappingTable userMappingTable, String relationName)
Adds a relationship between the base and related table. Creates the user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTableName
- related table nameuserMappingTable
- user mapping tablerelationName
- relation name- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserRelatedTable relatedTable, String mappingTableName)
Adds a relationship between the base and user related table. Creates a default user mapping table and the related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserRelatedTable relatedTable, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table. Creates the user mapping table and related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String mappingTableName)
Adds a relationship between the base and user related table. Creates a default user mapping table and the related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table. Creates the user mapping table and related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String relationName, String mappingTableName)
Adds a relationship between the base and user related table. Creates a default user mapping table and the related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tablerelationName
- relation namemappingTableName
- user mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addRelationship
public ExtendedRelation addRelationship(String baseTableName, UserTable<? extends UserColumn> relatedTable, String relationName, UserMappingTable userMappingTable)
Adds a relationship between the base and user related table. Creates the user mapping table and related table if needed.- Parameters:
baseTableName
- base table namerelatedTable
- user related tablerelationName
- relation nameuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addFeaturesRelationship
public ExtendedRelation addFeaturesRelationship(String baseFeaturesTableName, String relatedFeaturesTableName, String mappingTableName)
Adds a features relationship between the base feature and related feature table. Creates a default user mapping table if needed.- Parameters:
baseFeaturesTableName
- base features table namerelatedFeaturesTableName
- related features table namemappingTableName
- mapping table name- Returns:
- The relationship that was added
-
addFeaturesRelationship
public ExtendedRelation addFeaturesRelationship(String baseFeaturesTableName, String relatedFeaturesTableName, UserMappingTable userMappingTable)
Adds a features relationship between the base feature and related feature table. Creates the user mapping table if needed.- Parameters:
baseFeaturesTableName
- base features table namerelatedFeaturesTableName
- related features table nameuserMappingTable
- user mapping table- Returns:
- The relationship that was added
-
addMediaRelationship
public ExtendedRelation addMediaRelationship(String baseTableName, MediaTable mediaTable, String mappingTableName)
Adds a media relationship between the base table and user media related table. Creates a default user mapping table and the media table if needed.- Parameters:
baseTableName
- base table namemediaTable
- user media tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
-
addMediaRelationship
public ExtendedRelation addMediaRelationship(String baseTableName, MediaTable mediaTable, UserMappingTable userMappingTable)
Adds a media relationship between the base table and user media related table. Creates the user mapping table and media table if needed.- Parameters:
baseTableName
- base table namemediaTable
- user media tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
-
addSimpleAttributesRelationship
public ExtendedRelation addSimpleAttributesRelationship(String baseTableName, SimpleAttributesTable simpleAttributesTable, String mappingTableName)
Adds a simple attributes relationship between the base table and user simple attributes related table. Creates a default user mapping table and the simple attributes table if needed.- Parameters:
baseTableName
- base table namesimpleAttributesTable
- user simple attributes tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
-
addSimpleAttributesRelationship
public ExtendedRelation addSimpleAttributesRelationship(String baseTableName, SimpleAttributesTable simpleAttributesTable, UserMappingTable userMappingTable)
Adds a simple attributes relationship between the base table and user simple attributes related table. Creates the user mapping table and simple attributes table if needed.- Parameters:
baseTableName
- base table namesimpleAttributesTable
- user simple attributes tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
-
addAttributesRelationship
public ExtendedRelation addAttributesRelationship(String baseTableName, String relatedAttributesTableName, String mappingTableName)
Adds an attributes relationship between the base table and related attributes table. Creates a default user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedAttributesTableName
- related attributes table namemappingTableName
- mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addAttributesRelationship
public ExtendedRelation addAttributesRelationship(String baseTableName, String relatedAttributesTableName, UserMappingTable userMappingTable)
Adds an attributes relationship between the base table and related attributes table. Creates the user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedAttributesTableName
- related attributes table nameuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addAttributesRelationship
public ExtendedRelation addAttributesRelationship(String baseTableName, AttributesTable attributesTable, String mappingTableName)
Adds an attributes relationship between the base table and user attributes related table. Creates a default user mapping table and the attributes table if needed.- Parameters:
baseTableName
- base table nameattributesTable
- user attributes tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addAttributesRelationship
public ExtendedRelation addAttributesRelationship(String baseTableName, AttributesTable attributesTable, UserMappingTable userMappingTable)
Adds an attributes relationship between the base table and user attributes related table. Creates the user mapping table and an attributes table if needed.- Parameters:
baseTableName
- base table nameattributesTable
- user attributes tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addTilesRelationship
public ExtendedRelation addTilesRelationship(String baseTableName, String relatedTilesTableName, String mappingTableName)
Adds a tiles relationship between the base table and related tiles table. Creates a default user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTilesTableName
- related tiles table namemappingTableName
- mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addTilesRelationship
public ExtendedRelation addTilesRelationship(String baseTableName, String relatedTilesTableName, UserMappingTable userMappingTable)
Adds a tiles relationship between the base table and related tiles table. Creates the user mapping table if needed.- Parameters:
baseTableName
- base table namerelatedTilesTableName
- related tiles table nameuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addTilesRelationship
public ExtendedRelation addTilesRelationship(String baseTableName, TileTable tileTable, String mappingTableName)
Adds a tiles relationship between the base table and user tiles related table. Creates a default user mapping table and the tile table if needed.- Parameters:
baseTableName
- base table nametileTable
- user tile tablemappingTableName
- user mapping table name- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
addTilesRelationship
public ExtendedRelation addTilesRelationship(String baseTableName, TileTable tileTable, UserMappingTable userMappingTable)
Adds a tiles relationship between the base table and user tiles related table. Creates the user mapping table and a tile table if needed.- Parameters:
baseTableName
- base table nametileTable
- user tile tableuserMappingTable
- user mapping table- Returns:
- The relationship that was added
- Since:
- 3.2.0
-
createUserMappingTable
public boolean createUserMappingTable(String mappingTableName)
Create a default user mapping table and extension row if either does not exist. When not created, there is no guarantee that an existing table has the same schema as the provided tabled.- Parameters:
mappingTableName
- user mapping table name- Returns:
- true if table was created, false if the table already existed
-
createUserMappingTable
public boolean createUserMappingTable(UserMappingTable userMappingTable)
Create a user mapping table and extension row if either does not exist. When not created, there is no guarantee that an existing table has the same schema as the provided tabled.- Parameters:
userMappingTable
- user mapping table- Returns:
- true if table was created, false if the table already existed
-
createRelatedTable
public boolean createRelatedTable(UserTable<? extends UserColumn> relatedTable)
Create a user related table if it does not exist. When not created, there is no guarantee that an existing table has the same schema as the provided tabled.- Parameters:
relatedTable
- user related table- Returns:
- true if created, false if the table already existed
- Since:
- 3.2.0
-
removeRelationship
public void removeRelationship(String baseTableName, String relatedTableName, RelationType relationType)
Remove a specific relationship from the GeoPackage- Parameters:
baseTableName
- base table namerelatedTableName
- related table namerelationType
- relation type
-
removeRelationship
public void removeRelationship(String baseTableName, String relatedTableName, String relationAuthor, String relationName)
Remove a specific relationship from the GeoPackage- Parameters:
baseTableName
- base table namerelatedTableName
- related table namerelationAuthor
- relation authorrelationName
- relation name
-
removeRelationship
public void removeRelationship(ExtendedRelation extendedRelation)
Remove a specific relationship from the GeoPackage- Parameters:
extendedRelation
- extended relation
-
removeRelationship
public void removeRelationship(String baseTableName, String relatedTableName, String relationName)
Remove a specific relationship from the GeoPackage- Parameters:
baseTableName
- base table namerelatedTableName
- related table namerelationName
- relation name
-
removeRelationships
public void removeRelationships(String table)
Remove all relationships that include the table- Parameters:
table
- base or related table name- Since:
- 3.2.0
-
removeRelationshipsWithMappingTable
public void removeRelationshipsWithMappingTable(String mappingTable)
Remove all relationships with the mapping table- Parameters:
mappingTable
- mapping table- Since:
- 3.2.0
-
removeExtension
public void removeExtension()
Remove all trace of the extension
-
hasRelations
public boolean hasRelations(String baseTable, String relatedTable) throws SQLException
Determine if has one or more relations matching the base table and related table- Parameters:
baseTable
- base table namerelatedTable
- related table name- Returns:
- true if has relations
- Throws:
SQLException
- upon failure- Since:
- 3.2.0
-
getRelations
public List<ExtendedRelation> getRelations(String baseTable, String relatedTable)
Get the relations to the base table and related table- Parameters:
baseTable
- base table namerelatedTable
- related table name- Returns:
- extended relations
- Since:
- 3.2.0
-
hasRelations
public boolean hasRelations(String baseTable, String relatedTable, String mappingTable) throws SQLException
Determine if has one or more relations matching the non null provided values- Parameters:
baseTable
- base table namerelatedTable
- related table namemappingTable
- mapping table name- Returns:
- true if has relations
- Throws:
SQLException
- upon failure- Since:
- 3.2.0
-
getRelations
public List<ExtendedRelation> getRelations(String baseTable, String relatedTable, String mappingTable) throws SQLException
Get the relations matching the non null provided values- Parameters:
baseTable
- base table namerelatedTable
- related table namemappingTable
- mapping table name- Returns:
- extended relations
- Throws:
SQLException
- upon failure- Since:
- 3.2.0
-
hasRelations
public boolean hasRelations(String baseTable, String relatedTable, String relation, String mappingTable)
Determine if has one or more relations matching the non null provided values- Parameters:
baseTable
- base table namerelatedTable
- related table namerelation
- relation namemappingTable
- mapping table name- Returns:
- true if has relations
- Since:
- 3.2.0
-
getRelations
public List<ExtendedRelation> getRelations(String baseTable, String relatedTable, String relation, String mappingTable) throws SQLException
Get the relations matching the non null provided values- Parameters:
baseTable
- base table namerelatedTable
- related table namerelation
- relation namemappingTable
- mapping table name- Returns:
- extended relations
- Throws:
SQLException
- upon failure- Since:
- 3.2.0
-
hasRelations
public boolean hasRelations(String baseTable, String baseColumn, String relatedTable, String relatedColumn, String relation, String mappingTable)
Determine if has one or more relations matching the non null provided values- Parameters:
baseTable
- base table namebaseColumn
- base primary column namerelatedTable
- related table namerelatedColumn
- related primary column namerelation
- relation namemappingTable
- mapping table name- Returns:
- true if has relations
- Since:
- 3.2.0
-
getRelations
public List<ExtendedRelation> getRelations(String baseTable, String baseColumn, String relatedTable, String relatedColumn, String relation, String mappingTable)
Get the relations matching the non null provided values- Parameters:
baseTable
- base table namebaseColumn
- base primary column namerelatedTable
- related table namerelatedColumn
- related primary column namerelation
- relation namemappingTable
- mapping table name- Returns:
- extended relations
- Since:
- 3.2.0
-
buildRelationName
public String buildRelationName(String author, String name)
Build the custom relation name with author- Parameters:
author
- relation authorname
- base relation name- Returns:
- custom relation name
-
getBaseTableRelations
public List<ExtendedRelation> getBaseTableRelations(String baseTable) throws SQLException
Get the relations to the base table- Parameters:
baseTable
- base table name- Returns:
- extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasBaseTableRelations
public boolean hasBaseTableRelations(String baseTable) throws SQLException
Determine if there are relations to the base table- Parameters:
baseTable
- base table name- Returns:
- true if has extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
getRelatedTableRelations
public List<ExtendedRelation> getRelatedTableRelations(String relatedTable) throws SQLException
Get the relations to the related table- Parameters:
relatedTable
- related table name- Returns:
- extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasRelatedTableRelations
public boolean hasRelatedTableRelations(String relatedTable) throws SQLException
Determine if there are relations to the related table- Parameters:
relatedTable
- related table name- Returns:
- true if has extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
getTableRelations
public List<ExtendedRelation> getTableRelations(String table) throws SQLException
Get the relations to the table- Parameters:
table
- table name- Returns:
- extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
hasTableRelations
public boolean hasTableRelations(String table) throws SQLException
Determine if there are relations to the table- Parameters:
table
- table name- Returns:
- true if has extended relations
- Throws:
SQLException
- upon failure- Since:
- 6.3.0
-
-