Class ContentsIdExtension
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.nga.contents.ContentsIdExtension
-
public class ContentsIdExtension extends BaseExtension
This extension assigns a unique integer identifier to tables defined in the contents. Allows foreign key referencing to a contents (text based primary key) by an integer identifier.http://ngageoint.github.io/GeoPackage/docs/extensions/contents-id.html
- Since:
- 3.2.0
- Author:
- 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 Constructor Description ContentsIdExtension(GeoPackageCore geoPackage)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
count()
Get the count of contents idsContentsId
create(String tableName)
Create a contents idContentsId
create(Contents contents)
Create a contents idboolean
createContentsIdTable()
Create the Contents Id Table if it does not existlong
createId(String tableName)
Create a contents idlong
createId(Contents contents)
Create a contents idint
createIds()
Create contents ids for contents currently withoutint
createIds(String type)
Create contents ids for contents of the data type and currently withoutint
createIds(ContentsDataType type)
Create contents ids for contents of the data type and currently withoutboolean
delete(String tableName)
Delete the contents id for the tableboolean
delete(Contents contents)
Delete the contents id for the contentsint
deleteIds()
Delete all contents idsint
deleteIds(String type)
Delete contents ids for contents of the data typeint
deleteIds(ContentsDataType type)
Delete contents ids for contents of the data typeContentsId
get(String tableName)
Get the contents id objectContentsId
get(Contents contents)
Get the contents id objectContentsIdDao
getContentsIdDao()
Get a Contents Id DAOstatic ContentsIdDao
getContentsIdDao(GeoPackageCoreConnection db)
Get a Contents Id DAOstatic ContentsIdDao
getContentsIdDao(GeoPackageCore geoPackage)
Get a Contents Id DAOContentsIdDao
getDao()
Get the contents id DAOExtensions
getExtension()
Get the extensionLong
getId(String tableName)
Get the contents idLong
getId(Contents contents)
Get the contents idList<ContentsId>
getIds()
Get all contents idsList<ContentsId>
getIds(String type)
Get by contents data typeList<ContentsId>
getIds(ContentsDataType type)
Get by contents data typeList<String>
getMissing()
Get contents without contents idsList<String>
getMissing(String type)
Get contents by data type without contents idsList<String>
getMissing(ContentsDataType type)
Get contents by data type without contents idsContentsId
getOrCreate(String tableName)
Get or create a contents idContentsId
getOrCreate(Contents contents)
Get or create a contents idExtensions
getOrCreateExtension()
Get or create if needed the extensionlong
getOrCreateId(String tableName)
Get or create a contents idlong
getOrCreateId(Contents contents)
Get or create a contents idboolean
has()
Determine if the GeoPackage has the extensionvoid
removeExtension()
Remove all trace of the extension-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, 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
-
ContentsIdExtension
public ContentsIdExtension(GeoPackageCore geoPackage)
Constructor- Parameters:
geoPackage
- GeoPackage
-
-
Method Detail
-
getDao
public ContentsIdDao getDao()
Get the contents id DAO- Returns:
- dao
-
has
public boolean has()
Determine if the GeoPackage has the extension- Returns:
- true if has extension
-
get
public ContentsId get(Contents contents)
Get the contents id object- Parameters:
contents
- contents- Returns:
- contents id or null
-
get
public ContentsId get(String tableName)
Get the contents id object- Parameters:
tableName
- table name- Returns:
- contents id or null
-
getId
public Long getId(Contents contents)
Get the contents id- Parameters:
contents
- contents- Returns:
- contents id or null
-
getId
public Long getId(String tableName)
Get the contents id- Parameters:
tableName
- table name- Returns:
- contents id or null
-
create
public ContentsId create(Contents contents)
Create a contents id- Parameters:
contents
- contents- Returns:
- new contents id
-
create
public ContentsId create(String tableName)
Create a contents id- Parameters:
tableName
- table name- Returns:
- new contents id
-
createId
public long createId(Contents contents)
Create a contents id- Parameters:
contents
- contents- Returns:
- new contents id
-
createId
public long createId(String tableName)
Create a contents id- Parameters:
tableName
- table name- Returns:
- new contents id
-
getOrCreate
public ContentsId getOrCreate(Contents contents)
Get or create a contents id- Parameters:
contents
- contents- Returns:
- new or existing contents id
-
getOrCreate
public ContentsId getOrCreate(String tableName)
Get or create a contents id- Parameters:
tableName
- table name- Returns:
- new or existing contents id
-
getOrCreateId
public long getOrCreateId(Contents contents)
Get or create a contents id- Parameters:
contents
- contents- Returns:
- new or existing contents id
-
getOrCreateId
public long getOrCreateId(String tableName)
Get or create a contents id- Parameters:
tableName
- table name- Returns:
- new or existing contents id
-
delete
public boolean delete(Contents contents)
Delete the contents id for the contents- Parameters:
contents
- contents- Returns:
- true if deleted
-
delete
public boolean delete(String tableName)
Delete the contents id for the table- Parameters:
tableName
- table name- Returns:
- true if deleted
-
createIds
public int createIds()
Create contents ids for contents currently without- Returns:
- newly created contents ids count
-
createIds
public int createIds(ContentsDataType type)
Create contents ids for contents of the data type and currently without- Parameters:
type
- contents data type- Returns:
- newly created contents ids count
-
createIds
public int createIds(String type)
Create contents ids for contents of the data type and currently without- Parameters:
type
- contents data type- Returns:
- newly created contents ids count
-
deleteIds
public int deleteIds()
Delete all contents ids- Returns:
- deleted contents ids count
-
deleteIds
public int deleteIds(ContentsDataType type)
Delete contents ids for contents of the data type- Parameters:
type
- contents data type- Returns:
- deleted contents ids count
-
deleteIds
public int deleteIds(String type)
Delete contents ids for contents of the data type- Parameters:
type
- contents data type- Returns:
- deleted contents ids count
-
getIds
public List<ContentsId> getIds()
Get all contents ids- Returns:
- contents ids
-
count
public long count()
Get the count of contents ids- Returns:
- count
-
getIds
public List<ContentsId> getIds(ContentsDataType type)
Get by contents data type- Parameters:
type
- contents data type- Returns:
- contents ids
-
getIds
public List<ContentsId> getIds(String type)
Get by contents data type- Parameters:
type
- contents data type- Returns:
- contents ids
-
getMissing
public List<String> getMissing()
Get contents without contents ids- Returns:
- table names without contents ids
-
getMissing
public List<String> getMissing(ContentsDataType type)
Get contents by data type without contents ids- Parameters:
type
- contents data type- Returns:
- table names without contents ids
-
getMissing
public List<String> getMissing(String type)
Get contents by data type without contents ids- Parameters:
type
- contents data type- Returns:
- table names without contents ids
-
getOrCreateExtension
public Extensions getOrCreateExtension()
Get or create if needed the extension- Returns:
- extensions object
-
getExtension
public Extensions getExtension()
Get the extension- Returns:
- extensions object or null if one does not exist
-
removeExtension
public void removeExtension()
Remove all trace of the extension
-
getContentsIdDao
public ContentsIdDao getContentsIdDao()
Get a Contents Id DAO- Returns:
- contents id dao
- Since:
- 4.0.0
-
getContentsIdDao
public static ContentsIdDao getContentsIdDao(GeoPackageCore geoPackage)
Get a Contents Id DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- contents id dao
- Since:
- 4.0.0
-
getContentsIdDao
public static ContentsIdDao getContentsIdDao(GeoPackageCoreConnection db)
Get a Contents Id DAO- Parameters:
db
- database connection- Returns:
- contents id dao
- Since:
- 4.0.0
-
createContentsIdTable
public boolean createContentsIdTable()
Create the Contents Id Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
-