Package mil.nga.geopackage.srs
Class SpatialReferenceSystemDao
- java.lang.Object
- 
- com.j256.ormlite.dao.BaseDaoImpl<T,ID>
- 
- mil.nga.geopackage.db.GeoPackageDao<SpatialReferenceSystem,Long>
- 
- mil.nga.geopackage.srs.SpatialReferenceSystemDao
 
 
 
- 
- All Implemented Interfaces:
- CloseableIterable<SpatialReferenceSystem>,- Dao<SpatialReferenceSystem,Long>,- Iterable<SpatialReferenceSystem>
 
 public class SpatialReferenceSystemDao extends GeoPackageDao<SpatialReferenceSystem,Long> Spatial Reference System Data Access Object- Author:
- osbornb
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.j256.ormlite.dao.DaoDao.CreateOrUpdateStatus, Dao.DaoObserver
 
- 
 - 
Field Summary- 
Fields inherited from class mil.nga.geopackage.db.GeoPackageDaodb
 - 
Fields inherited from class com.j256.ormlite.dao.BaseDaoImplconnectionSource, constructor, databaseType, dataClass, lastIterator, objectFactory, statementExecutor, tableConfig, tableInfo
 
- 
 - 
Constructor SummaryConstructors Constructor Description SpatialReferenceSystemDao(ConnectionSource connectionSource, Class<SpatialReferenceSystem> dataClass)Constructor, required by ORMLite
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpatialReferenceSystemDaocreate(GeoPackageCoreConnection db)Create the DAOstatic SpatialReferenceSystemDaocreate(GeoPackageCore geoPackage)Create the DAOintcreate(SpatialReferenceSystem srs)SpatialReferenceSystemcreateIfNotExists(SpatialReferenceSystem data)Dao.CreateOrUpdateStatuscreateOrUpdate(SpatialReferenceSystem data)SpatialReferenceSystemcreateUndefinedCartesian()Creates the required Undefined Cartesian Spatial Reference System (spec Requirement 11)SpatialReferenceSystemcreateUndefinedGeographic()Creates the required Undefined Geographic Spatial Reference System (spec Requirement 11)SpatialReferenceSystemcreateWebMercator()Creates the Web Mercator Spatial Reference System if it does not already existSpatialReferenceSystemcreateWgs84()Creates the required EPSG WGS84 Spatial Reference System (spec Requirement 11)SpatialReferenceSystemcreateWgs84Geographical3D()Creates the required EPSG WGS84 Geographical 3D Spatial Reference SystemintdeleteByIdCascade(Long id)Delete a Spatial Reference System by id, cascadingintdeleteCascade(PreparedQuery<SpatialReferenceSystem> preparedDelete)Delete the Spatial Reference Systems matching the prepared query, cascadingintdeleteCascade(Collection<SpatialReferenceSystem> srsCollection)Delete the collection of Spatial Reference Systems, cascadingintdeleteCascade(SpatialReferenceSystem srs)Delete the Spatial Reference System, cascadingintdeleteIdsCascade(Collection<Long> idCollection)Delete the Spatial Reference Systems with the provided ids, cascadingStringgetDefinition_12_063(long srsId)Query to get the definition 12 063 value if the extension existsDoublegetEpoch(long srsId)Query to get the epoch value if the extension existsSpatialReferenceSystemgetOrCreate(Projection projection)Get or Create the Spatial Reference System from the projectionSpatialReferenceSystemgetOrCreateCode(String organization, long coordsysId)Get or Create the Spatial Reference System for the provided organization and idSpatialReferenceSystemgetOrCreateFromEpsg(long epsg)Get or Create the Spatial Reference System for the provided epsgbooleanhasDefinition_12_063()Determine if the SRS table contains the extension definition 12 063 column for CRS WKTbooleanhasEpoch()Determine if the SRS table contains the extension epoch column for CRS WKTList<SpatialReferenceSystem>query(PreparedQuery<SpatialReferenceSystem> preparedQuery)SpatialReferenceSystemquery(Projection projection)Query for the projectionList<SpatialReferenceSystem>queryForAll()List<SpatialReferenceSystem>queryForEq(String fieldName, Object value)List<SpatialReferenceSystem>queryForFieldValues(Map<String,Object> fieldValues)List<SpatialReferenceSystem>queryForFieldValuesArgs(Map<String,Object> fieldValues)SpatialReferenceSystemqueryForFirst(PreparedQuery<SpatialReferenceSystem> preparedQuery)SpatialReferenceSystemqueryForId(Long id)List<SpatialReferenceSystem>queryForMatching(SpatialReferenceSystem matchObj)List<SpatialReferenceSystem>queryForMatchingArgs(SpatialReferenceSystem matchObj)SpatialReferenceSystemqueryForOrganizationCoordsysId(String organization, long organizationCoordsysId)Query for the organization coordsys idSpatialReferenceSystemqueryForSameId(SpatialReferenceSystem data)voidsetCrsWktExtension(CrsWktExtension crsWktExtension)Set the CRS WKT ExtensionvoidsetExtension(Collection<SpatialReferenceSystem> srsList)Query and set the values in the srs objects if the extension existsvoidsetExtension(SpatialReferenceSystem srs)Query and set the values in the srs object if the extension existsstatic voidsetExtensionValues(GeoPackageCoreConnection db, SpatialReferenceSystem srs)Set extension values into the spatial reference systemstatic voidsetExtensionValues(GeoPackageCore geoPackage, SpatialReferenceSystem srs)Set extension values into the spatial reference systemintupdate(SpatialReferenceSystem data)voidupdateDefinition_12_063(long srsId, String definition)Update the definition 12 063 in the database if the extension existsvoidupdateEpoch(long srsId, Double epoch)Update the epoch in the database if the extension existsvoidupdateExtension(SpatialReferenceSystem srs)Update the extension if exists- 
Methods inherited from class mil.nga.geopackage.db.GeoPackageDaocreateDao, createDao, createDao, dropTable, getDatabase, isTable, isTableExists, isTableOrView, isView, setDatabase, tableExists, tableOrViewExists, verifyExists, viewExists
 - 
Methods inherited from class com.j256.ormlite.dao.BaseDaoImplassignEmptyForeignCollection, 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, queryBuilder, queryForFirst, queryRaw, queryRaw, queryRaw, queryRaw, queryRaw, queryRawValue, refresh, registerObserver, rollBack, setAutoCommit, setConnectionSource, setObjectCache, setObjectCache, setObjectFactory, setTableConfig, startThreadConnection, unregisterObserver, update, updateBuilder, updateId, updateRaw
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Constructor Detail- 
SpatialReferenceSystemDaopublic SpatialReferenceSystemDao(ConnectionSource connectionSource, Class<SpatialReferenceSystem> dataClass) throws SQLException Constructor, required by ORMLite- Parameters:
- connectionSource- connection source
- dataClass- data class
- Throws:
- SQLException- upon creation failure
 
 
- 
 - 
Method Detail- 
createpublic static SpatialReferenceSystemDao create(GeoPackageCore geoPackage) Create the DAO- Parameters:
- geoPackage- GeoPackage
- Returns:
- dao
- Since:
- 4.0.0
 
 - 
createpublic static SpatialReferenceSystemDao create(GeoPackageCoreConnection db) Create the DAO- Parameters:
- db- database connection
- Returns:
- dao
- Since:
- 4.0.0
 
 - 
setExtensionValuespublic static void setExtensionValues(GeoPackageCore geoPackage, SpatialReferenceSystem srs) Set extension values into the spatial reference system- Parameters:
- geoPackage- GeoPackage
- srs- spatial reference system
 
 - 
setExtensionValuespublic static void setExtensionValues(GeoPackageCoreConnection db, SpatialReferenceSystem srs) Set extension values into the spatial reference system- Parameters:
- db- database connection
- srs- spatial reference system
 
 - 
setCrsWktExtensionpublic void setCrsWktExtension(CrsWktExtension crsWktExtension) Set the CRS WKT Extension- Parameters:
- crsWktExtension- CRS WKT Extension
- Since:
- 1.1.8
 
 - 
hasDefinition_12_063public boolean hasDefinition_12_063() Determine if the SRS table contains the extension definition 12 063 column for CRS WKT- Returns:
- true if has extension
- Since:
- 1.2.1
 
 - 
hasEpochpublic boolean hasEpoch() Determine if the SRS table contains the extension epoch column for CRS WKT- Returns:
- true if has extension
- Since:
- 6.6.0
 
 - 
createWgs84public SpatialReferenceSystem createWgs84() throws SQLException Creates the required EPSG WGS84 Spatial Reference System (spec Requirement 11)- Returns:
- spatial reference system
- Throws:
- SQLException- upon creation failure
 
 - 
createUndefinedCartesianpublic SpatialReferenceSystem createUndefinedCartesian() throws SQLException Creates the required Undefined Cartesian Spatial Reference System (spec Requirement 11)- Returns:
- spatial reference system
- Throws:
- SQLException- upon creation failure
 
 - 
createUndefinedGeographicpublic SpatialReferenceSystem createUndefinedGeographic() throws SQLException Creates the required Undefined Geographic Spatial Reference System (spec Requirement 11)- Returns:
- spatial reference system
- Throws:
- SQLException- upon creation failure
 
 - 
createWebMercatorpublic SpatialReferenceSystem createWebMercator() throws SQLException Creates the Web Mercator Spatial Reference System if it does not already exist- Returns:
- spatial reference system
- Throws:
- SQLException- upon creation failure
 
 - 
createWgs84Geographical3Dpublic SpatialReferenceSystem createWgs84Geographical3D() throws SQLException Creates the required EPSG WGS84 Geographical 3D Spatial Reference System- Returns:
- spatial reference system
- Throws:
- SQLException- upon creation failure
- Since:
- 1.2.1
 
 - 
getDefinition_12_063public String getDefinition_12_063(long srsId) Query to get the definition 12 063 value if the extension exists- Parameters:
- srsId- srs id
- Returns:
- definition or null
- Since:
- 1.2.1
 
 - 
getEpochpublic Double getEpoch(long srsId) Query to get the epoch value if the extension exists- Parameters:
- srsId- srs id
- Returns:
- epoch or null
- Since:
- 6.6.0
 
 - 
setExtensionpublic void setExtension(SpatialReferenceSystem srs) Query and set the values in the srs object if the extension exists- Parameters:
- srs- spatial reference system
- Since:
- 6.6.0
 
 - 
setExtensionpublic void setExtension(Collection<SpatialReferenceSystem> srsList) Query and set the values in the srs objects if the extension exists- Parameters:
- srsList- srs list
- Since:
- 6.6.0
 
 - 
updateDefinition_12_063public void updateDefinition_12_063(long srsId, String definition)Update the definition 12 063 in the database if the extension exists- Parameters:
- srsId- srs id
- definition- definition
- Since:
- 1.2.1
 
 - 
updateEpochpublic void updateEpoch(long srsId, Double epoch)Update the epoch in the database if the extension exists- Parameters:
- srsId- srs id
- epoch- epoch
- Since:
- 6.6.0
 
 - 
updateExtensionpublic void updateExtension(SpatialReferenceSystem srs) Update the extension if exists- Parameters:
- srs- srs
- Since:
- 6.6.0
 
 - 
queryForIdpublic SpatialReferenceSystem queryForId(Long id) throws SQLException - Specified by:
- queryForIdin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForIdin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForFirstpublic SpatialReferenceSystem queryForFirst(PreparedQuery<SpatialReferenceSystem> preparedQuery) throws SQLException - Specified by:
- queryForFirstin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForFirstin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForAllpublic List<SpatialReferenceSystem> queryForAll() throws SQLException - Specified by:
- queryForAllin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForAllin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForEqpublic List<SpatialReferenceSystem> queryForEq(String fieldName, Object value) throws SQLException - Specified by:
- queryForEqin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForEqin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
querypublic List<SpatialReferenceSystem> query(PreparedQuery<SpatialReferenceSystem> preparedQuery) throws SQLException - Specified by:
- queryin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForMatchingpublic List<SpatialReferenceSystem> queryForMatching(SpatialReferenceSystem matchObj) throws SQLException - Specified by:
- queryForMatchingin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForMatchingin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForMatchingArgspublic List<SpatialReferenceSystem> queryForMatchingArgs(SpatialReferenceSystem matchObj) throws SQLException - Specified by:
- queryForMatchingArgsin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForMatchingArgsin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForFieldValuespublic List<SpatialReferenceSystem> queryForFieldValues(Map<String,Object> fieldValues) throws SQLException - Specified by:
- queryForFieldValuesin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForFieldValuesin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForFieldValuesArgspublic List<SpatialReferenceSystem> queryForFieldValuesArgs(Map<String,Object> fieldValues) throws SQLException - Specified by:
- queryForFieldValuesArgsin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForFieldValuesArgsin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
queryForSameIdpublic SpatialReferenceSystem queryForSameId(SpatialReferenceSystem data) throws SQLException - Specified by:
- queryForSameIdin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- queryForSameIdin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
createpublic int create(SpatialReferenceSystem srs) throws SQLException - Specified by:
- createin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- createin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
createIfNotExistspublic SpatialReferenceSystem createIfNotExists(SpatialReferenceSystem data) throws SQLException - Specified by:
- createIfNotExistsin interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- createIfNotExistsin class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
createOrUpdatepublic Dao.CreateOrUpdateStatus createOrUpdate(SpatialReferenceSystem data) throws SQLException - Specified by:
- createOrUpdatein interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- createOrUpdatein class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
updatepublic int update(SpatialReferenceSystem data) throws SQLException - Specified by:
- updatein interface- Dao<SpatialReferenceSystem,Long>
- Overrides:
- updatein class- BaseDaoImpl<SpatialReferenceSystem,Long>
- Throws:
- SQLException
 
 - 
getOrCreateFromEpsgpublic SpatialReferenceSystem getOrCreateFromEpsg(long epsg) throws SQLException Get or Create the Spatial Reference System for the provided epsg- Parameters:
- epsg- epsg
- Returns:
- srs
- Throws:
- SQLException- upon query or creation failure
- Since:
- 1.2.0
 
 - 
getOrCreateCodepublic SpatialReferenceSystem getOrCreateCode(String organization, long coordsysId) throws SQLException Get or Create the Spatial Reference System for the provided organization and id- Parameters:
- organization- organization
- coordsysId- coordsys id
- Returns:
- srs
- Throws:
- SQLException- upon query or creation failure
- Since:
- 1.3.0
 
 - 
getOrCreatepublic SpatialReferenceSystem getOrCreate(Projection projection) throws SQLException Get or Create the Spatial Reference System from the projection- Parameters:
- projection- projection
- Returns:
- srs
- Throws:
- SQLException- upon query or creation failure
- Since:
- 5.0.0
 
 - 
queryForOrganizationCoordsysIdpublic SpatialReferenceSystem queryForOrganizationCoordsysId(String organization, long organizationCoordsysId) throws SQLException Query for the organization coordsys id- Parameters:
- organization- organization
- organizationCoordsysId- organization coordsys id
- Returns:
- srs
- Throws:
- SQLException- upon query failure
- Since:
- 1.3.0
 
 - 
querypublic SpatialReferenceSystem query(Projection projection) throws SQLException Query for the projection- Parameters:
- projection- projection
- Returns:
- srs
- Throws:
- SQLException- upon query failure
- Since:
- 5.0.0
 
 - 
deleteCascadepublic int deleteCascade(SpatialReferenceSystem srs) throws SQLException Delete the Spatial Reference System, cascading- Parameters:
- srs- spatial reference system
- Returns:
- deleted count
- Throws:
- SQLException- upon deletion failure
 
 - 
deleteCascadepublic int deleteCascade(Collection<SpatialReferenceSystem> srsCollection) throws SQLException Delete the collection of Spatial Reference Systems, cascading- Parameters:
- srsCollection- spatial reference system collection
- Returns:
- deleted count
- Throws:
- SQLException- upon deletion failure
 
 - 
deleteCascadepublic int deleteCascade(PreparedQuery<SpatialReferenceSystem> preparedDelete) throws SQLException Delete the Spatial Reference Systems matching the prepared query, cascading- Parameters:
- preparedDelete- prepared delete query
- Returns:
- deleted count
- Throws:
- SQLException- upon deletion failure
 
 - 
deleteByIdCascadepublic int deleteByIdCascade(Long id) throws SQLException Delete a Spatial Reference System by id, cascading- Parameters:
- id- id
- Returns:
- deleted count
- Throws:
- SQLException- upon deletion failure
 
 - 
deleteIdsCascadepublic int deleteIdsCascade(Collection<Long> idCollection) throws SQLException Delete the Spatial Reference Systems with the provided ids, cascading- Parameters:
- idCollection- id collection
- Returns:
- deleted count
- Throws:
- SQLException- upon deletion failure
 
 
- 
 
-