Class MetadataReferenceDao
- java.lang.Object
-
- com.j256.ormlite.dao.BaseDaoImpl<T,ID>
-
- mil.nga.geopackage.db.GeoPackageDao<MetadataReference,Void>
-
- mil.nga.geopackage.extension.metadata.reference.MetadataReferenceDao
-
- All Implemented Interfaces:
CloseableIterable<MetadataReference>
,Dao<MetadataReference,Void>
,Iterable<MetadataReference>
public class MetadataReferenceDao extends GeoPackageDao<MetadataReference,Void>
Metadata Reference 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 MetadataReferenceDao(ConnectionSource connectionSource, Class<MetadataReference> dataClass)
Constructor, required by ORMLite
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetadataReferenceDao
create(GeoPackageCoreConnection db)
Create the DAOstatic MetadataReferenceDao
create(GeoPackageCore geoPackage)
Create the DAOint
delete(MetadataReference metadataReference)
int
deleteByMetadata(long fileId)
Delete metadata references with foreign keys to the metadata file idint
deleteByTableName(String tableName)
Delete by table nameList<MetadataReference>
queryByMetadata(long fileId)
Query by the metadata idsList<MetadataReference>
queryByMetadata(long fileId, Long parentId)
Query by the metadata idsList<MetadataReference>
queryByMetadataParent(long parentId)
Query by the metadata parent idsList<MetadataReference>
queryByTable(String tableName)
Query by table nameint
removeMetadataParent(long parentId)
Remove metadata references (by updating the field to null) with foreign keys to the metadata parent idint
update(MetadataReference metadataReference)
-
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, create, createIfNotExists, createObjectInstance, createOrUpdate, 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, 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
-
MetadataReferenceDao
public MetadataReferenceDao(ConnectionSource connectionSource, Class<MetadataReference> dataClass) throws SQLException
Constructor, required by ORMLite- Parameters:
connectionSource
- connectiondataClass
- data class- Throws:
SQLException
- upon failure
-
-
Method Detail
-
create
public static MetadataReferenceDao create(GeoPackageCore geoPackage)
Create the DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- dao
- Since:
- 4.0.0
-
create
public static MetadataReferenceDao create(GeoPackageCoreConnection db)
Create the DAO- Parameters:
db
- database connection- Returns:
- dao
- Since:
- 4.0.0
-
update
public int update(MetadataReference metadataReference) throws SQLException
Update using the foreign key columns
- Specified by:
update
in interfaceDao<MetadataReference,Void>
- Overrides:
update
in classBaseDaoImpl<MetadataReference,Void>
- Throws:
SQLException
-
delete
public int delete(MetadataReference metadataReference) throws SQLException
Delete using the foreign key columns
- Specified by:
delete
in interfaceDao<MetadataReference,Void>
- Overrides:
delete
in classBaseDaoImpl<MetadataReference,Void>
- Throws:
SQLException
-
deleteByMetadata
public int deleteByMetadata(long fileId) throws SQLException
Delete metadata references with foreign keys to the metadata file id- Parameters:
fileId
- file id- Returns:
- deleted count
- Throws:
SQLException
- upon failure
-
removeMetadataParent
public int removeMetadataParent(long parentId) throws SQLException
Remove metadata references (by updating the field to null) with foreign keys to the metadata parent id- Parameters:
parentId
- parent id- Returns:
- updated count
- Throws:
SQLException
- upon failure
-
queryByMetadata
public List<MetadataReference> queryByMetadata(long fileId, Long parentId) throws SQLException
Query by the metadata ids- Parameters:
fileId
- file idparentId
- parent id- Returns:
- metadata references
- Throws:
SQLException
- upon failure
-
queryByMetadata
public List<MetadataReference> queryByMetadata(long fileId) throws SQLException
Query by the metadata ids- Parameters:
fileId
- file id- Returns:
- metadata references
- Throws:
SQLException
- upon failure
-
queryByMetadataParent
public List<MetadataReference> queryByMetadataParent(long parentId) throws SQLException
Query by the metadata parent ids- Parameters:
parentId
- parent id- Returns:
- metadata references
- Throws:
SQLException
- upon failure
-
queryByTable
public List<MetadataReference> queryByTable(String tableName) throws SQLException
Query by table name- Parameters:
tableName
- table name- Returns:
- metadata references
- Throws:
SQLException
- upon failure- Since:
- 3.3.0
-
deleteByTableName
public int deleteByTableName(String tableName) throws SQLException
Delete by table name- Parameters:
tableName
- table name- Returns:
- rows deleted
- Throws:
SQLException
- upon failure- Since:
- 3.2.0
-
-