Package mil.nga.geopackage.contents
Class ContentsDao
- java.lang.Object
-
- com.j256.ormlite.dao.BaseDaoImpl<T,ID>
-
- mil.nga.geopackage.db.GeoPackageDao<Contents,String>
-
- mil.nga.geopackage.contents.ContentsDao
-
public class ContentsDao extends GeoPackageDao<Contents,String>
Contents Data Access Object- Author:
- osbornb
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.j256.ormlite.dao.Dao
Dao.CreateOrUpdateStatus, Dao.DaoObserver
-
-
Field Summary
-
Fields inherited from class mil.nga.geopackage.db.GeoPackageDao
db
-
Fields inherited from class com.j256.ormlite.dao.BaseDaoImpl
connectionSource, constructor, databaseType, dataClass, lastIterator, objectFactory, statementExecutor, tableConfig, tableInfo
-
-
Constructor Summary
Constructors Constructor Description ContentsDao(ConnectionSource connectionSource, Class<Contents> dataClass)
Constructor, required by ORMLite
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
create(Contents contents)
static ContentsDao
create(GeoPackageCoreConnection db)
Create the DAOstatic ContentsDao
create(GeoPackageCore geoPackage)
Create the DAOContents
createIfNotExists(Contents contents)
Dao.CreateOrUpdateStatus
createOrUpdate(Contents contents)
int
deleteByIdCascade(String id)
Delete a Contents by id, cascadingint
deleteByIdCascade(String id, boolean userTable)
Delete a Contents by id, cascading optionally including the user tableint
deleteCascade(PreparedQuery<Contents> preparedDelete)
Delete the Contents matching the prepared query, cascadingint
deleteCascade(PreparedQuery<Contents> preparedDelete, boolean userTable)
Delete the Contents matching the prepared query, cascading optionally including the user tableint
deleteCascade(Collection<Contents> contentsCollection)
Delete the collection of Contents, cascadingint
deleteCascade(Collection<Contents> contentsCollection, boolean userTable)
Delete the collection of Contents, cascading optionally including the user tableint
deleteCascade(Contents contents)
Delete the Contents, cascadingint
deleteCascade(Contents contents, boolean userTable)
Delete the Contents, cascading optionally including the user tableint
deleteIdsCascade(Collection<String> idCollection)
Delete the Contents with the provided ids, cascadingint
deleteIdsCascade(Collection<String> idCollection, boolean userTable)
Delete the Contents with the provided ids, cascading optionally including the user tablevoid
deleteTable(String table)
Delete the tableBoundingBox
getBoundingBox(String table)
Get the bounding box for the table in the table's projectionBoundingBox
getBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projectionBoundingBox
getBoundingBox(Projection projection, String table)
Get the bounding box for the table in the provided projectionList<Contents>
getContents(String dataType)
Get contents by data typeList<Contents>
getContents(String... dataTypes)
Get contents by data typesList<Contents>
getContents(ContentsDataType dataType)
Get contents by data typeList<Contents>
getContents(ContentsDataType... dataTypes)
Get contents by data typesList<String>
getTables()
Get table namesList<String>
getTables(String dataType)
Get table names by data typeList<String>
getTables(String... dataTypes)
Get table names by data typesList<String>
getTables(ContentsDataType dataType)
Get table names by data typeList<String>
getTables(ContentsDataType... dataTypes)
Get table names by data typesContents
queryForId(String id)
-
Methods inherited from class mil.nga.geopackage.db.GeoPackageDao
createDao, createDao, createDao, dropTable, getDatabase, isTable, isTableExists, isTableOrView, isView, setDatabase, tableExists, tableOrViewExists, verifyExists, viewExists
-
Methods inherited from class com.j256.ormlite.dao.BaseDaoImpl
assignEmptyForeignCollection, callBatchTasks, checkForInitialized, clearAllInternalObjectCaches, clearObjectCache, closeableIterator, closeLastIterator, commit, countOf, countOf, create, createObjectInstance, delete, delete, delete, deleteBuilder, deleteById, deleteIds, endThreadConnection, executeRaw, executeRawNoArgs, extractId, findForeignFieldType, getConnectionSource, getDataClass, getEmptyForeignCollection, getObjectCache, getRawRowMapper, getSelectStarRowMapper, getTableConfig, getTableInfo, getTableName, getWrappedIterable, getWrappedIterable, idExists, initialize, isAutoCommit, isUpdatable, iterator, iterator, iterator, iterator, mapSelectStarRow, notifyChanges, objectsEqual, objectToString, query, queryBuilder, queryForAll, queryForEq, queryForFieldValues, queryForFieldValuesArgs, queryForFirst, queryForFirst, queryForMatching, queryForMatchingArgs, queryForSameId, queryRaw, queryRaw, queryRaw, queryRaw, queryRaw, queryRawValue, refresh, registerObserver, rollBack, setAutoCommit, setConnectionSource, setObjectCache, setObjectCache, setObjectFactory, setTableConfig, startThreadConnection, unregisterObserver, update, update, updateBuilder, updateId, updateRaw
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ContentsDao
public ContentsDao(ConnectionSource connectionSource, Class<Contents> dataClass) throws SQLException
Constructor, required by ORMLite- Parameters:
connectionSource
- connection sourcedataClass
- data class- Throws:
SQLException
- upon creation error
-
-
Method Detail
-
create
public static ContentsDao create(GeoPackageCore geoPackage)
Create the DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- dao
- Since:
- 4.0.0
-
create
public static ContentsDao create(GeoPackageCoreConnection db)
Create the DAO- Parameters:
db
- database connection- Returns:
- dao
- Since:
- 4.0.0
-
create
public int create(Contents contents) throws SQLException
Verify optional tables have been created
- Specified by:
create
in interfaceDao<Contents,String>
- Overrides:
create
in classBaseDaoImpl<Contents,String>
- Throws:
SQLException
-
createIfNotExists
public Contents createIfNotExists(Contents contents) throws SQLException
Verify optional tables have been created
- Specified by:
createIfNotExists
in interfaceDao<Contents,String>
- Overrides:
createIfNotExists
in classBaseDaoImpl<Contents,String>
- Throws:
SQLException
-
createOrUpdate
public Dao.CreateOrUpdateStatus createOrUpdate(Contents contents) throws SQLException
Verify optional tables have been created
- Specified by:
createOrUpdate
in interfaceDao<Contents,String>
- Overrides:
createOrUpdate
in classBaseDaoImpl<Contents,String>
- Throws:
SQLException
-
queryForId
public Contents queryForId(String id) throws SQLException
- Specified by:
queryForId
in interfaceDao<Contents,String>
- Overrides:
queryForId
in classBaseDaoImpl<Contents,String>
- Throws:
SQLException
-
getTables
public List<String> getTables(ContentsDataType dataType) throws SQLException
Get table names by data type- Parameters:
dataType
- data type- Returns:
- table names
- Throws:
SQLException
- upon query error- Since:
- 1.2.1
-
getTables
public List<String> getTables(ContentsDataType... dataTypes) throws SQLException
Get table names by data types- Parameters:
dataTypes
- data types- Returns:
- table names
- Throws:
SQLException
- upon query error- Since:
- 4.0.0
-
getTables
public List<String> getTables(String dataType) throws SQLException
Get table names by data type- Parameters:
dataType
- data type- Returns:
- table names
- Throws:
SQLException
- upon query error- Since:
- 3.0.1
-
getTables
public List<String> getTables(String... dataTypes) throws SQLException
Get table names by data types- Parameters:
dataTypes
- data types- Returns:
- table names
- Throws:
SQLException
- upon query error- Since:
- 4.0.0
-
getContents
public List<Contents> getContents(ContentsDataType dataType) throws SQLException
Get contents by data type- Parameters:
dataType
- data type- Returns:
- list of contents
- Throws:
SQLException
- upon query error- Since:
- 1.2.1
-
getContents
public List<Contents> getContents(ContentsDataType... dataTypes) throws SQLException
Get contents by data types- Parameters:
dataTypes
- data types- Returns:
- list of contents
- Throws:
SQLException
- upon query error- Since:
- 4.0.0
-
getContents
public List<Contents> getContents(String dataType) throws SQLException
Get contents by data type- Parameters:
dataType
- data type- Returns:
- list of contents
- Throws:
SQLException
- upon query error- Since:
- 3.0.1
-
getContents
public List<Contents> getContents(String... dataTypes) throws SQLException
Get contents by data types- Parameters:
dataTypes
- data types- Returns:
- list of contents
- Throws:
SQLException
- upon query error- Since:
- 4.0.0
-
getTables
public List<String> getTables() throws SQLException
Get table names- Returns:
- table names
- Throws:
SQLException
- upon query error- Since:
- 1.2.1
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection)
Get the bounding box for all tables in the provided projection- Parameters:
projection
- desired bounding box projection- Returns:
- bounding box
- Since:
- 3.1.0
-
getBoundingBox
public BoundingBox getBoundingBox(String table)
Get the bounding box for the table in the table's projection- Parameters:
table
- table name- Returns:
- bounding box
- Since:
- 3.1.0
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection, String table)
Get the bounding box for the table in the provided projection- Parameters:
projection
- desired bounding box projectiontable
- table name- Returns:
- bounding box
- Since:
- 3.1.0
-
deleteCascade
public int deleteCascade(Contents contents) throws SQLException
Delete the Contents, cascading- Parameters:
contents
- contents- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteCascade
public int deleteCascade(Contents contents, boolean userTable) throws SQLException
Delete the Contents, cascading optionally including the user table- Parameters:
contents
- contentsuserTable
- true if a user table- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteCascade
public int deleteCascade(Collection<Contents> contentsCollection) throws SQLException
Delete the collection of Contents, cascading- Parameters:
contentsCollection
- contents collection- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteCascade
public int deleteCascade(Collection<Contents> contentsCollection, boolean userTable) throws SQLException
Delete the collection of Contents, cascading optionally including the user table- Parameters:
contentsCollection
- contents collectionuserTable
- true if a user table- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteCascade
public int deleteCascade(PreparedQuery<Contents> preparedDelete) throws SQLException
Delete the Contents matching the prepared query, cascading- Parameters:
preparedDelete
- prepared delete query- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteCascade
public int deleteCascade(PreparedQuery<Contents> preparedDelete, boolean userTable) throws SQLException
Delete the Contents matching the prepared query, cascading optionally including the user table- Parameters:
preparedDelete
- prepared delete queryuserTable
- true if a user table- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteByIdCascade
public int deleteByIdCascade(String id) throws SQLException
Delete a Contents by id, cascading- Parameters:
id
- id- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteByIdCascade
public int deleteByIdCascade(String id, boolean userTable) throws SQLException
Delete a Contents by id, cascading optionally including the user table- Parameters:
id
- iduserTable
- true if a user table- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteIdsCascade
public int deleteIdsCascade(Collection<String> idCollection) throws SQLException
Delete the Contents with the provided ids, cascading- Parameters:
idCollection
- id collection- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteIdsCascade
public int deleteIdsCascade(Collection<String> idCollection, boolean userTable) throws SQLException
Delete the Contents with the provided ids, cascading optionally including the user table- Parameters:
idCollection
- id collectionuserTable
- true if a user table- Returns:
- deleted count
- Throws:
SQLException
- upon deletion error
-
deleteTable
public void deleteTable(String table)
Delete the table- Parameters:
table
- table name
-
-