Class DataColumnsDao
- java.lang.Object
-
- com.j256.ormlite.dao.BaseDaoImpl<T,ID>
-
- mil.nga.geopackage.db.GeoPackageDao<DataColumns,TableColumnKey>
-
- mil.nga.geopackage.extension.schema.columns.DataColumnsDao
-
- All Implemented Interfaces:
CloseableIterable<DataColumns>
,Dao<DataColumns,TableColumnKey>
,Iterable<DataColumns>
public class DataColumnsDao extends GeoPackageDao<DataColumns,TableColumnKey>
Data Columns 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 DataColumnsDao(ConnectionSource connectionSource, Class<DataColumns> dataClass)
Constructor, required by ORMLite
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataColumnsDao
create(GeoPackageCoreConnection db)
Create the DAOstatic DataColumnsDao
create(GeoPackageCore geoPackage)
Create the DAOint
delete(DataColumns data)
int
deleteById(String tableName, String columnName)
Delete by id with table name and column nameint
deleteById(TableColumnKey id)
int
deleteByTableName(String tableName)
Delete by table nameint
deleteIds(Collection<TableColumnKey> idCollection)
TableColumnKey
extractId(DataColumns data)
DataColumns
getDataColumn(String tableName, String columnName)
Get DataColumn by column name and table nameDataColumns
getSchema(String table, String column)
Get the column schemaboolean
idExists(TableColumnKey id)
void
loadSchema(String table, List<? extends UserColumn> columns)
Load the columns schemavoid
loadSchema(String table, UserColumn column)
Load the column schemavoid
loadSchema(UserColumns<? extends UserColumn> columns)
Load the columns schemavoid
loadSchema(UserTable<? extends UserColumn> table)
Load the table schemaList<DataColumns>
queryByConstraintName(String constraintName)
Query by the constraint nameList<DataColumns>
queryByTable(String tableName)
Query by table nameDataColumns
queryForId(TableColumnKey key)
DataColumns
queryForSameId(DataColumns data)
void
saveSchema(String table, List<? extends UserColumn> columns)
Save the columns schemavoid
saveSchema(String table, UserColumn column)
Save the column schemavoid
saveSchema(UserColumns<? extends UserColumn> columns)
Save the columns schemavoid
saveSchema(UserTable<? extends UserColumn> table)
Save the table schemaint
update(DataColumns dataColumns)
int
updateId(DataColumns data, TableColumnKey newId)
-
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, endThreadConnection, executeRaw, executeRawNoArgs, findForeignFieldType, getConnectionSource, getDataClass, getEmptyForeignCollection, getObjectCache, getRawRowMapper, getSelectStarRowMapper, getTableConfig, getTableInfo, getTableName, getWrappedIterable, getWrappedIterable, initialize, isAutoCommit, isUpdatable, iterator, iterator, iterator, iterator, mapSelectStarRow, notifyChanges, objectsEqual, objectToString, query, queryBuilder, queryForAll, queryForEq, queryForFieldValues, queryForFieldValuesArgs, queryForFirst, queryForFirst, queryForMatching, queryForMatchingArgs, queryRaw, queryRaw, queryRaw, queryRaw, queryRaw, queryRawValue, refresh, registerObserver, rollBack, setAutoCommit, setConnectionSource, setObjectCache, setObjectCache, setObjectFactory, setTableConfig, startThreadConnection, unregisterObserver, update, updateBuilder, 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
-
DataColumnsDao
public DataColumnsDao(ConnectionSource connectionSource, Class<DataColumns> dataClass) throws SQLException
Constructor, required by ORMLite- Parameters:
connectionSource
- connection sourcedataClass
- data class- Throws:
SQLException
- upon failure
-
-
Method Detail
-
create
public static DataColumnsDao create(GeoPackageCore geoPackage)
Create the DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- dao
- Since:
- 4.0.0
-
create
public static DataColumnsDao create(GeoPackageCoreConnection db)
Create the DAO- Parameters:
db
- database connection- Returns:
- dao
- Since:
- 4.0.0
-
queryForId
public DataColumns queryForId(TableColumnKey key) throws SQLException
- Specified by:
queryForId
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
queryForId
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
extractId
public TableColumnKey extractId(DataColumns data) throws SQLException
- Specified by:
extractId
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
extractId
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
idExists
public boolean idExists(TableColumnKey id) throws SQLException
- Specified by:
idExists
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
idExists
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
queryForSameId
public DataColumns queryForSameId(DataColumns data) throws SQLException
- Specified by:
queryForSameId
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
queryForSameId
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
updateId
public int updateId(DataColumns data, TableColumnKey newId) throws SQLException
- Specified by:
updateId
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
updateId
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
delete
public int delete(DataColumns data) throws SQLException
- Specified by:
delete
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
delete
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
deleteById
public int deleteById(TableColumnKey id) throws SQLException
- Specified by:
deleteById
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
deleteById
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
deleteById
public int deleteById(String tableName, String columnName) throws SQLException
Delete by id with table name and column name- Parameters:
tableName
- table namecolumnName
- column name- Returns:
- number of rows deleted
- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
deleteIds
public int deleteIds(Collection<TableColumnKey> idCollection) throws SQLException
- Specified by:
deleteIds
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
deleteIds
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
update
public int update(DataColumns dataColumns) throws SQLException
Update using the complex key
- Specified by:
update
in interfaceDao<DataColumns,TableColumnKey>
- Overrides:
update
in classBaseDaoImpl<DataColumns,TableColumnKey>
- Throws:
SQLException
-
queryByConstraintName
public List<DataColumns> queryByConstraintName(String constraintName) throws SQLException
Query by the constraint name- Parameters:
constraintName
- constraint name- Returns:
- data columns
- Throws:
SQLException
- upon failure
-
getDataColumn
public DataColumns getDataColumn(String tableName, String columnName) throws SQLException
Get DataColumn by column name and table name- Parameters:
tableName
- table name to query forcolumnName
- column name to query for- Returns:
- DataColumns
- Throws:
SQLException
- upon failure
-
queryByTable
public List<DataColumns> queryByTable(String tableName) throws SQLException
Query by table name- Parameters:
tableName
- table name- Returns:
- data columns
- 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
-
saveSchema
public void saveSchema(UserTable<? extends UserColumn> table) throws SQLException
Save the table schema- Parameters:
table
- user table- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
saveSchema
public void saveSchema(UserColumns<? extends UserColumn> columns) throws SQLException
Save the columns schema- Parameters:
columns
- user columns- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
saveSchema
public void saveSchema(String table, List<? extends UserColumn> columns) throws SQLException
Save the columns schema- Parameters:
table
- table namecolumns
- user columns- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
saveSchema
public void saveSchema(String table, UserColumn column) throws SQLException
Save the column schema- Parameters:
table
- table namecolumn
- user column- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
loadSchema
public void loadSchema(UserTable<? extends UserColumn> table) throws SQLException
Load the table schema- Parameters:
table
- user table- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
loadSchema
public void loadSchema(UserColumns<? extends UserColumn> columns) throws SQLException
Load the columns schema- Parameters:
columns
- user columns- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
loadSchema
public void loadSchema(String table, List<? extends UserColumn> columns) throws SQLException
Load the columns schema- Parameters:
table
- table namecolumns
- user columns- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
loadSchema
public void loadSchema(String table, UserColumn column) throws SQLException
Load the column schema- Parameters:
table
- table namecolumn
- user column- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
getSchema
public DataColumns getSchema(String table, String column) throws SQLException
Get the column schema- Parameters:
table
- table namecolumn
- column name- Returns:
- column schema or null
- Throws:
SQLException
- upon failure- Since:
- 6.6.7
-
-