Package mil.nga.geopackage.user
Class UserDao<TColumn extends UserColumn,TTable extends UserTable<TColumn>,TRow extends UserRow<TColumn,TTable>,TResult extends UserCursor<TColumn,TTable,TRow>>
java.lang.Object
mil.nga.geopackage.user.UserCoreDao<TColumn,TTable,TRow,TResult>
mil.nga.geopackage.user.UserDao<TColumn,TTable,TRow,TResult>
- Type Parameters:
TColumn
- column typeTTable
- table typeTRow
- row typeTResult
- result type
- Direct Known Subclasses:
AttributesDao
,FeatureDao
,TileDao
,UserCustomDao
public abstract class UserDao<TColumn extends UserColumn,TTable extends UserTable<TColumn>,TRow extends UserRow<TColumn,TTable>,TResult extends UserCursor<TColumn,TTable,TRow>>
extends UserCoreDao<TColumn,TTable,TRow,TResult>
Abstract User DAO for reading user tables
-
Field Summary
Fields inherited from class mil.nga.geopackage.user.UserCoreDao
projection
-
Constructor Summary
ModifierConstructorDescriptionprotected
UserDao
(String database, GeoPackageConnection db, UserConnection<TColumn, TTable, TRow, TResult> userDb, TTable table) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
commit()
void
endTransaction
(boolean successful) Get the database connectiongetDb()
long
insert
(ContentValues values) Inserts a new rowlong
long
insertOrThrow
(ContentValues values) Inserts a new rowboolean
boolean
Is the invalid requery flag enabled? When enabled (default is true) large invalid user rows are requeried and handled.protected TResult
prepareResult
(TResult result) Query using the user query argumentsQuery using the previous result query argumentsqueryForIdRow
(long id) Handles requery of invalid id rowprotected void
renameTableColumn
(String columnName, String newColumnName) Alter Table in SQLite does not support renaming columns until version 3.25.0 Once Android supports column rename alter table statements, this method override can be removed.void
setInvalidRequery
(boolean invalidRequery) Set the invalid requery flag.boolean
setUseBindings
(boolean useBindings) Set the active SQLite connection as the bindings or standardint
update
(ContentValues values, String whereClause, String[] whereArgs) Update all rows matching the where clause with the provided valuesint
Methods inherited from class mil.nga.geopackage.user.UserCoreDao
addColumn, alterColumn, alterColumns, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAsNull, buildColumnsAsNull, buildLimit, buildValueWhere, buildValueWhereArgs, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereIn, buildWhereInArgs, buildWhereLike, buildWhereLike, buildWhereNull, columnCount, count, count, count, count, count, count, count, count, countColumn, countColumnIn, countColumnIn, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForFieldValues, countForFieldValues, countForFieldValues, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForValueFieldValues, countForValueFieldValues, countForValueFieldValues, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, create, createDao, delete, delete, delete, deleteAll, deleteById, dropColumn, dropColumn, dropColumn, dropColumnIndexes, dropColumnNames, dropColumns, dropTable, endAndBeginTransaction, endTransaction, failTransaction, getBoundingBox, getBoundingBox, getColumnNames, getColumns, getContents, getDatabase, getPkColumn, getPkColumnIndex, getPkColumnName, getPkWhere, getPkWhereArgs, getProjection, getTable, getTableName, getUserDb, getXRange, getXRange, getYRange, getYRange, getZoomLevel, hasPkColumn, isPkModifiable, isValueValidation, max, max, min, min, newRow, projectBoundingBox, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, queryAs, queryAs, queryForAll, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForFieldValues, queryForFieldValues, queryForFieldValues, queryForFieldValues, queryForId, queryForId, queryForId, queryForId, queryForIdRow, queryForIdRow, queryForIdRow, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForValueFieldValues, queryForValueFieldValues, queryForValueFieldValues, queryForValueFieldValues, queryIdsSQL, queryIdsSQL, queryIdsSQL, queryIdsSQL, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryResults, queryResults, queryResults, queryResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleResult, querySingleResult, querySingleResult, querySingleResult, querySingleRowResults, querySingleRowResults, querySingleRowTypedResults, querySingleRowTypedResults, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, queryTypedResults, queryTypedResults, queryTypedResults, queryTypedResults, rawQuery, rawQuery, rawQuery, renameColumn, renameColumn, renameColumn, setPkModifiable, setValueValidation
-
Constructor Details
-
UserDao
protected UserDao(String database, GeoPackageConnection db, UserConnection<TColumn, TTable, TRow, TResult> userDb, TTable table) Constructor- Parameters:
database
- database namedb
- GeoPackage connectionuserDb
- user connectiontable
- table
-
-
Method Details
-
getDb
-
getDatabaseConnection
Get the database connection- Returns:
- database
- Since:
- 1.3.1
-
setUseBindings
public boolean setUseBindings(boolean useBindings) Set the active SQLite connection as the bindings or standard- Parameters:
useBindings
- true to use bindings connection, false for standard- Returns:
- previous bindings value
- Since:
- 3.4.0
-
isInvalidRequery
public boolean isInvalidRequery()Is the invalid requery flag enabled? When enabled (default is true) large invalid user rows are requeried and handled.- Returns:
- invalid requery flag
- Since:
- 2.0.0
-
setInvalidRequery
public void setInvalidRequery(boolean invalidRequery) Set the invalid requery flag. When enabled (default is true) large invalid user rows are requeried and handled.- Parameters:
invalidRequery
- invalid requery flag- Since:
- 2.0.0
-
prepareResult
- Specified by:
prepareResult
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-
beginTransaction
public void beginTransaction()- Specified by:
beginTransaction
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-
endTransaction
public void endTransaction(boolean successful) - Specified by:
endTransaction
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-
commit
public void commit() -
inTransaction
public boolean inTransaction()- Specified by:
inTransaction
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-
queryForIdRow
Handles requery of invalid id row- Overrides:
queryForIdRow
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-
query
Query using the previous result query arguments- Parameters:
previousResult
- previous result- Returns:
- result
- Since:
- 2.0.0
-
query
Query using the user query arguments- Parameters:
query
- user query- Returns:
- result
- Since:
- 2.0.0
-
update
-
update
Update all rows matching the where clause with the provided values- Parameters:
values
- content valueswhereClause
- where clausewhereArgs
- where arguments- Returns:
- updated rows
-
insert
-
insert
Inserts a new row- Parameters:
values
- content values- Returns:
- row id, -1 on error
-
insertOrThrow
Inserts a new row- Parameters:
values
- content values- Returns:
- row id
-
renameTableColumn
Alter Table in SQLite does not support renaming columns until version 3.25.0 Once Android supports column rename alter table statements, this method override can be removed.- Overrides:
renameTableColumn
in classUserCoreDao<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>, TResult extends UserCursor<TColumn, TTable, TRow>>
-