Package mil.nga.geopackage.db
Class GeoPackageDao<T,ID>
- java.lang.Object
-
- com.j256.ormlite.dao.BaseDaoImpl<T,ID>
-
- mil.nga.geopackage.db.GeoPackageDao<T,ID>
-
- Type Parameters:
T
- The class that the code will be operating on.ID
- The class of the ID column associated with the class. The T class does not require an ID field. The class needs an ID parameter however so you can use Void or Object to satisfy the compiler.
- All Implemented Interfaces:
CloseableIterable<T>
,Dao<T,ID>
,Iterable<T>
- Direct Known Subclasses:
ContentsDao
,ContentsIdDao
,DataColumnConstraintsDao
,DataColumnsDao
,ExtendedRelationsDao
,ExtensionsDao
,ExtTileMatrixDao
,ExtTileMatrixSetDao
,FeatureTileLinkDao
,GeometryColumnsDao
,GeometryColumnsSfSqlDao
,GeometryColumnsSqlMmDao
,GeometryIndexDao
,GriddedCoverageDao
,GriddedTileDao
,MetadataDao
,MetadataReferenceDao
,SpatialReferenceSystemDao
,SpatialReferenceSystemSfSqlDao
,SpatialReferenceSystemSqlMmDao
,StylesDao
,StylesheetsDao
,SymbolContentDao
,SymbolImagesDao
,SymbolsDao
,TableIndexDao
,TileMatrixDao
,TileMatrixSetDao
,TileMatrixTablesDao
,TileMatrixVariableWidthsDao
,TileScalingDao
,VectorTilesFieldsDao
,VectorTilesLayersDao
public abstract class GeoPackageDao<T,ID> extends BaseDaoImpl<T,ID>
Abstract GeoPackage DAO- Since:
- 4.0.0
- Author:
- osbornb
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.j256.ormlite.dao.Dao
Dao.CreateOrUpdateStatus, Dao.DaoObserver
-
-
Field Summary
Fields Modifier and Type Field Description protected GeoPackageCoreConnection
db
Database connection-
Fields inherited from class com.j256.ormlite.dao.BaseDaoImpl
connectionSource, constructor, databaseType, dataClass, lastIterator, objectFactory, statementExecutor, tableConfig, tableInfo
-
-
Constructor Summary
Constructors Constructor Description GeoPackageDao(ConnectionSource connectionSource, Class<T> dataClass)
Constructor, required by ORMLite
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <D extends GeoPackageDao<O,?>,O>
DcreateDao(Class<O> clazz)
Create a GeoPackage DAOstatic <D extends GeoPackageDao<O,?>,O>
DcreateDao(GeoPackageCoreConnection db, DatabaseTableConfig<O> tableConfig)
Create a GeoPackage DAOstatic <D extends GeoPackageDao<O,?>,O>
DcreateDao(GeoPackageCoreConnection db, Class<O> clazz)
Create a GeoPackage DAOvoid
dropTable(String table)
Drop the tableGeoPackageCoreConnection
getDatabase()
Get the databaseboolean
isTable()
Check if the DAO is backed by a tableboolean
isTableExists()
boolean
isTableOrView()
Check if the DAO is backed by a table or a viewboolean
isView()
Check if the DAO is backed by a viewvoid
setDatabase(GeoPackageCoreConnection db)
Set the databaseboolean
tableExists(String tableName)
Check if the table existsboolean
tableOrViewExists(String name)
Check if a table or view exists with the namevoid
verifyExists()
Verify the DAO is backed by a table or viewboolean
viewExists(String viewName)
Check if the view exists-
Methods inherited from class com.j256.ormlite.dao.BaseDaoImpl
assignEmptyForeignCollection, callBatchTasks, checkForInitialized, clearAllInternalObjectCaches, clearObjectCache, closeableIterator, closeLastIterator, commit, countOf, countOf, create, create, createIfNotExists, createObjectInstance, createOrUpdate, 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, queryForId, 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
-
-
-
-
Field Detail
-
db
protected GeoPackageCoreConnection db
Database connection
-
-
Constructor Detail
-
GeoPackageDao
public GeoPackageDao(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException
Constructor, required by ORMLite- Parameters:
connectionSource
- connection sourcedataClass
- data class- Throws:
SQLException
- upon failure
-
-
Method Detail
-
isTableExists
public boolean isTableExists() throws SQLException
Check if the DAO is backed by a table or a view
- Specified by:
isTableExists
in interfaceDao<T,ID>
- Overrides:
isTableExists
in classBaseDaoImpl<T,ID>
- Returns:
- true if a table or view exists
- Throws:
SQLException
-
isTableOrView
public boolean isTableOrView()
Check if the DAO is backed by a table or a view- Returns:
- true if a table or view exists
-
isTable
public boolean isTable()
Check if the DAO is backed by a table- Returns:
- true if a table exists
-
isView
public boolean isView()
Check if the DAO is backed by a view- Returns:
- true if a view exists
-
verifyExists
public void verifyExists()
Verify the DAO is backed by a table or view- Since:
- 4.0.0
-
setDatabase
public void setDatabase(GeoPackageCoreConnection db)
Set the database- Parameters:
db
- database connection
-
getDatabase
public GeoPackageCoreConnection getDatabase()
Get the database- Returns:
- database connection
-
dropTable
public void dropTable(String table)
Drop the table- Parameters:
table
- table name
-
tableExists
public boolean tableExists(String tableName)
Check if the table exists- Parameters:
tableName
- table name- Returns:
- true if exists
-
viewExists
public boolean viewExists(String viewName)
Check if the view exists- Parameters:
viewName
- view name- Returns:
- true if exists
-
tableOrViewExists
public boolean tableOrViewExists(String name)
Check if a table or view exists with the name- Parameters:
name
- table or view name- Returns:
- true if exists
-
createDao
public <D extends GeoPackageDao<O,?>,O> D createDao(Class<O> clazz)
Create a GeoPackage DAO- Type Parameters:
D
- DAO typeO
- DAO object type- Parameters:
clazz
- DAO class type- Returns:
- GeoPackage DAO
-
createDao
public static <D extends GeoPackageDao<O,?>,O> D createDao(GeoPackageCoreConnection db, Class<O> clazz)
Create a GeoPackage DAO- Type Parameters:
D
- DAO typeO
- DAO object type- Parameters:
db
- database connectionclazz
- DAO class type- Returns:
- GeoPackage DAO
-
createDao
public static <D extends GeoPackageDao<O,?>,O> D createDao(GeoPackageCoreConnection db, DatabaseTableConfig<O> tableConfig) throws SQLException
Create a GeoPackage DAO- Type Parameters:
D
- DAO typeO
- DAO object type- Parameters:
db
- database connectiontableConfig
- table config- Returns:
- GeoPackage DAO
- Throws:
SQLException
- upon error- Since:
- 4.0.0
-
-