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 DataColumnsDaocreate(GeoPackageCoreConnection db)Create the DAOstatic DataColumnsDaocreate(GeoPackageCore geoPackage)Create the DAOintdelete(DataColumns data)intdeleteById(String tableName, String columnName)Delete by id with table name and column nameintdeleteById(TableColumnKey id)intdeleteByTableName(String tableName)Delete by table nameintdeleteIds(Collection<TableColumnKey> idCollection)TableColumnKeyextractId(DataColumns data)DataColumnsgetDataColumn(String tableName, String columnName)Get DataColumn by column name and table nameDataColumnsgetSchema(String table, String column)Get the column schemabooleanidExists(TableColumnKey id)voidloadSchema(String table, List<? extends UserColumn> columns)Load the columns schemavoidloadSchema(String table, UserColumn column)Load the column schemavoidloadSchema(UserColumns<? extends UserColumn> columns)Load the columns schemavoidloadSchema(UserTable<? extends UserColumn> table)Load the table schemaList<DataColumns>queryByConstraintName(String constraintName)Query by the constraint nameList<DataColumns>queryByTable(String tableName)Query by table nameDataColumnsqueryForId(TableColumnKey key)DataColumnsqueryForSameId(DataColumns data)voidsaveSchema(String table, List<? extends UserColumn> columns)Save the columns schemavoidsaveSchema(String table, UserColumn column)Save the column schemavoidsaveSchema(UserColumns<? extends UserColumn> columns)Save the columns schemavoidsaveSchema(UserTable<? extends UserColumn> table)Save the table schemaintupdate(DataColumns dataColumns)intupdateId(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:
queryForIdin interfaceDao<DataColumns,TableColumnKey>- Overrides:
queryForIdin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
extractId
public TableColumnKey extractId(DataColumns data) throws SQLException
- Specified by:
extractIdin interfaceDao<DataColumns,TableColumnKey>- Overrides:
extractIdin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
idExists
public boolean idExists(TableColumnKey id) throws SQLException
- Specified by:
idExistsin interfaceDao<DataColumns,TableColumnKey>- Overrides:
idExistsin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
queryForSameId
public DataColumns queryForSameId(DataColumns data) throws SQLException
- Specified by:
queryForSameIdin interfaceDao<DataColumns,TableColumnKey>- Overrides:
queryForSameIdin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
updateId
public int updateId(DataColumns data, TableColumnKey newId) throws SQLException
- Specified by:
updateIdin interfaceDao<DataColumns,TableColumnKey>- Overrides:
updateIdin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
delete
public int delete(DataColumns data) throws SQLException
- Specified by:
deletein interfaceDao<DataColumns,TableColumnKey>- Overrides:
deletein classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
deleteById
public int deleteById(TableColumnKey id) throws SQLException
- Specified by:
deleteByIdin interfaceDao<DataColumns,TableColumnKey>- Overrides:
deleteByIdin 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:
deleteIdsin interfaceDao<DataColumns,TableColumnKey>- Overrides:
deleteIdsin classBaseDaoImpl<DataColumns,TableColumnKey>- Throws:
SQLException
-
update
public int update(DataColumns dataColumns) throws SQLException
Update using the complex key
- Specified by:
updatein interfaceDao<DataColumns,TableColumnKey>- Overrides:
updatein 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
-
-