TColumn - column typeTTable - table typeTRow - row typeTResult - result typepublic abstract class UserCoreDao<TColumn extends UserColumn,TTable extends UserTable<TColumn>,TRow extends UserCoreRow<TColumn,TTable>,TResult extends UserCoreResult<TColumn,TTable,TRow>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected mil.nga.sf.proj.Projection |
projection
Projection
|
| Modifier | Constructor and Description |
|---|---|
protected |
UserCoreDao(String database,
GeoPackageCoreConnection db,
UserCoreConnection<TColumn,TTable,TRow,TResult> userDb,
TTable table)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
buildColumnsAs(List<TColumn> columns,
String value)
Build "columns as" values for the table columns with the specified
columns as the specified value
|
String[] |
buildColumnsAs(List<TColumn> columns,
String[] values)
Build "columns as" values for the table columns with the specified
columns as the specified values
|
String[] |
buildColumnsAs(Map<String,String> columns)
Build "columns as" values for the table column to value mapping
|
String[] |
buildColumnsAs(String[] columns,
String value)
Build "columns as" values for the table columns with the specified
columns as the specified value
|
String[] |
buildColumnsAs(String[] columns,
String[] values)
Build "columns as" values for the table columns with the specified
columns as the specified values
|
String[] |
buildColumnsAsNull(List<TColumn> columns)
Build "columns as" values for the table columns with the specified
columns as null
|
String[] |
buildColumnsAsNull(String[] columns)
Build "columns as" values for the table columns with the specified
columns as null
|
String |
buildLimit(int limit,
long offset)
Build a limit String with the limit and offset
|
String |
buildValueWhere(Set<Map.Entry<String,ColumnValue>> fields)
Build where (or selection) statement from the fields
|
String[] |
buildValueWhereArgs(Collection<ColumnValue> values)
Build where (or selection) args for the values
|
String |
buildWhere(Set<Map.Entry<String,Object>> fields)
Build where (or selection) statement from the fields
|
String |
buildWhere(String field,
ColumnValue value)
Build where (or selection) statement for a single field
|
String |
buildWhere(String field,
Object value)
Build where (or selection) statement for a single field
|
String |
buildWhere(String field,
Object value,
String operation)
Build where (or selection) statement for a single field using the
provided operation
|
String[] |
buildWhereArgs(Collection<Object> values)
Build where (or selection) args for the values
|
String[] |
buildWhereArgs(ColumnValue value)
Build where (or selection) args for the value
|
String[] |
buildWhereArgs(Object value)
Build where (or selection) args for the value
|
String[] |
buildWhereArgs(Object[] values)
Build where (or selection) args for the values
|
String |
buildWhereLike(String field,
ColumnValue value)
Build where (or selection) LIKE statement for a single field
|
String |
buildWhereLike(String field,
Object value)
Build where (or selection) LIKE statement for a single field
|
int |
count()
Get the total count
|
int |
count(String where,
String[] args)
Get the count
|
long |
create(TRow row)
Creates a new row, same as calling
insert(UserCoreRow) |
int |
delete(Map<String,Object> fieldValues)
Delete rows matching the field values
|
int |
delete(String whereClause,
String[] whereArgs)
Delete rows matching the where clause
|
int |
delete(TRow row)
Delete the row
|
int |
deleteAll()
Delete all rows
|
int |
deleteById(long id)
Delete a row by id
|
void |
dropTable()
Drop the user table
|
abstract BoundingBox |
getBoundingBox()
Get the bounding box of the user table data
|
abstract BoundingBox |
getBoundingBox(mil.nga.sf.proj.Projection projection)
Get the bounding box of the user table data
|
String |
getDatabase()
Get the database
|
GeoPackageCoreConnection |
getDb()
Get the database connection
|
protected String |
getPkWhere(long id)
Get the primary key where clause
|
protected String[] |
getPkWhereArgs(long id)
Get the primary key where args
|
mil.nga.sf.proj.Projection |
getProjection()
Get the projection
|
TTable |
getTable()
Get the table
|
String |
getTableName()
Get the table name
|
UserCoreConnection<TColumn,TTable,TRow,TResult> |
getUserDb()
Get the user database connection
|
int |
getZoomLevel()
Get the approximate zoom level of where the bounding box of the user data
fits into the world
|
abstract long |
insert(TRow row)
Inserts a new row
|
Integer |
max(String column,
String where,
String[] args)
Get the max result of the column
|
Integer |
min(String column,
String where,
String[] args)
Get the min result of the column
|
abstract TRow |
newRow()
Get a new empty row
|
protected abstract TResult |
prepareResult(TResult result)
Prepare the result before returning
|
BoundingBox |
projectBoundingBox(BoundingBox boundingBox,
mil.nga.sf.proj.Projection projection)
Project the provided bounding box in the declared projection to the user
DAO projection
|
TResult |
query(String where,
String[] whereArgs)
Query for rows
|
TResult |
query(String where,
String[] whereArgs,
String groupBy,
String having,
String orderBy)
Query for rows
|
TResult |
query(String where,
String[] whereArgs,
String groupBy,
String having,
String orderBy,
String limit)
Query for rows
|
TResult |
queryForAll()
Query for all rows
|
TResult |
queryForAll(String[] columnsAs)
Query for all rows with "columns as" values for corresponding column
indices.
|
TResult |
queryForChunk(int limit,
long offset)
Query for id ordered rows starting at the offset and returning no more
than the limit.
|
TResult |
queryForChunk(String orderBy,
int limit,
long offset)
Query for ordered rows starting at the offset and returning no more than
the limit.
|
TResult |
queryForEq(String fieldName,
ColumnValue value)
Query for the row where the field equals the value
|
TResult |
queryForEq(String fieldName,
Object value)
Query for the row where the field equals the value
|
TResult |
queryForEq(String fieldName,
Object value,
String groupBy,
String having,
String orderBy)
Query for the row where the field equals the value
|
TResult |
queryForFieldValues(Map<String,Object> fieldValues)
Query for the row where all fields match their values
|
TResult |
queryForId(long id)
Query for the row with the provided id
|
TRow |
queryForIdRow(long id)
Query for the row with the provided id
|
TResult |
queryForLike(String fieldName,
ColumnValue value)
Query for the row where the field is like the value
|
TResult |
queryForLike(String fieldName,
Object value)
Query for the row where the field is like the value
|
TResult |
queryForLike(String fieldName,
Object value,
String groupBy,
String having,
String orderBy)
Query for the row where the field equals the value
|
TResult |
queryForValueFieldValues(Map<String,ColumnValue> fieldValues)
Query for the row where all fields match their values
|
List<List<Object>> |
queryResults(String sql,
String[] args)
Query for values
|
List<List<Object>> |
queryResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes)
Query for values
|
List<List<Object>> |
queryResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes,
Integer limit)
Query for values up to the limit
|
List<List<Object>> |
queryResults(String sql,
String[] args,
Integer limit)
Query for values
|
List<Object> |
querySingleColumnResults(String sql,
String[] args)
Query for values from the first column
|
List<Object> |
querySingleColumnResults(String sql,
String[] args,
GeoPackageDataType dataType)
Query for values from the first column
|
List<Object> |
querySingleColumnResults(String sql,
String[] args,
int column)
Query for values from a single column
|
List<Object> |
querySingleColumnResults(String sql,
String[] args,
int column,
GeoPackageDataType dataType)
Query for values from a single column
|
List<Object> |
querySingleColumnResults(String sql,
String[] args,
int column,
GeoPackageDataType dataType,
Integer limit)
Query for values from a single column up to the limit
|
List<Object> |
querySingleColumnResults(String sql,
String[] args,
int column,
Integer limit)
Query for values from a single column up to the limit
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args)
Query for typed values from the first column
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args,
GeoPackageDataType dataType)
Query for typed values from the first column
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args,
int column)
Query for typed values from a single column
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args,
int column,
GeoPackageDataType dataType)
Query for typed values from a single column
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args,
int column,
GeoPackageDataType dataType,
Integer limit)
Query for typed values from a single column up to the limit
|
<T> List<T> |
querySingleColumnTypedResults(String sql,
String[] args,
int column,
Integer limit)
Query for typed values from a single column up to the limit
|
Object |
querySingleResult(String sql,
String[] args)
Query the SQL for a single result object in the first column
|
Object |
querySingleResult(String sql,
String[] args,
GeoPackageDataType dataType)
Query the SQL for a single result object in the first column with the
expected data type
|
Object |
querySingleResult(String sql,
String[] args,
int column)
Query the SQL for a single result object
|
Object |
querySingleResult(String sql,
String[] args,
int column,
GeoPackageDataType dataType)
Query the SQL for a single result object with the expected data type
|
List<Object> |
querySingleRowResults(String sql,
String[] args)
Query for string values in a single (first) row
|
List<Object> |
querySingleRowResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes)
Query for values in a single (first) row
|
<T> List<T> |
querySingleRowTypedResults(String sql,
String[] args)
Query for string typed values in a single (first) row
|
<T> List<T> |
querySingleRowTypedResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes)
Query for typed values in a single (first) row
|
<T> T |
querySingleTypedResult(String sql,
String[] args)
Query the SQL for a single result typed object in the first column
|
<T> T |
querySingleTypedResult(String sql,
String[] args,
GeoPackageDataType dataType)
Query the SQL for a single result typed object in the first column with
the expected data type
|
<T> T |
querySingleTypedResult(String sql,
String[] args,
int column)
Query the SQL for a single result typed object
|
<T> T |
querySingleTypedResult(String sql,
String[] args,
int column,
GeoPackageDataType dataType)
Query the SQL for a single result typed object with the expected data
type
|
<T> List<List<T>> |
queryTypedResults(String sql,
String[] args)
Query for typed values
|
<T> List<List<T>> |
queryTypedResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes)
Query for typed values
|
<T> List<List<T>> |
queryTypedResults(String sql,
String[] args,
GeoPackageDataType[] dataTypes,
Integer limit)
Query for typed values up to the limit
|
<T> List<List<T>> |
queryTypedResults(String sql,
String[] args,
Integer limit)
Query for typed values
|
abstract int |
update(TRow row)
Update the row
|
protected mil.nga.sf.proj.Projection projection
protected UserCoreDao(String database, GeoPackageCoreConnection db, UserCoreConnection<TColumn,TTable,TRow,TResult> userDb, TTable table)
database - database namedb - GeoPackage connectionuserDb - user connectiontable - tablepublic abstract TRow newRow()
public abstract BoundingBox getBoundingBox()
public abstract BoundingBox getBoundingBox(mil.nga.sf.proj.Projection projection)
projection - desired projectionpublic BoundingBox projectBoundingBox(BoundingBox boundingBox, mil.nga.sf.proj.Projection projection)
boundingBox - bounding boxprojection - projectionprotected abstract TResult prepareResult(TResult result)
result - resultpublic String getDatabase()
public GeoPackageCoreConnection getDb()
public UserCoreConnection<TColumn,TTable,TRow,TResult> getUserDb()
public String getTableName()
public TTable getTable()
public mil.nga.sf.proj.Projection getProjection()
public void dropTable()
public TResult queryForAll()
public TResult queryForAll(String[] columnsAs)
columnsAs - columns as valuespublic TResult queryForEq(String fieldName, Object value)
fieldName - field namevalue - valuepublic TResult queryForEq(String fieldName, Object value, String groupBy, String having, String orderBy)
fieldName - field namevalue - valuegroupBy - group byhaving - havingorderBy - order bypublic TResult queryForEq(String fieldName, ColumnValue value)
fieldName - field namevalue - column valuepublic TResult queryForLike(String fieldName, Object value)
fieldName - field namevalue - valuepublic TResult queryForLike(String fieldName, Object value, String groupBy, String having, String orderBy)
fieldName - field namevalue - valuegroupBy - group by statementhaving - having statementorderBy - order by statementpublic TResult queryForLike(String fieldName, ColumnValue value)
fieldName - field namevalue - column valuepublic TResult queryForFieldValues(Map<String,Object> fieldValues)
fieldValues - field valuespublic TResult queryForValueFieldValues(Map<String,ColumnValue> fieldValues)
fieldValues - field valuespublic TResult queryForId(long id)
id - idpublic TRow queryForIdRow(long id)
id - idpublic TResult query(String where, String[] whereArgs)
where - where clausewhereArgs - where argumentspublic TResult query(String where, String[] whereArgs, String groupBy, String having, String orderBy)
where - where clausewhereArgs - where argumentsgroupBy - group byhaving - havingorderBy - order bypublic TResult query(String where, String[] whereArgs, String groupBy, String having, String orderBy, String limit)
where - where clausewhereArgs - where argumentsgroupBy - group byhaving - havingorderBy - order bylimit - limitpublic TResult queryForChunk(int limit, long offset)
limit - chunk limitoffset - chunk query offsetpublic TResult queryForChunk(String orderBy, int limit, long offset)
orderBy - order bylimit - chunk limitoffset - chunk query offsetpublic String buildLimit(int limit, long offset)
limit - limitoffset - offsetpublic abstract int update(TRow row)
row - rowpublic int delete(TRow row)
row - rowpublic int deleteById(long id)
id - idpublic int delete(String whereClause, String[] whereArgs)
whereClause - where clausewhereArgs - where argumentspublic int delete(Map<String,Object> fieldValues)
fieldValues - field valuespublic int deleteAll()
public long create(TRow row)
insert(UserCoreRow)row - rowpublic abstract long insert(TRow row)
row - rowprotected String getPkWhere(long id)
id - idprotected String[] getPkWhereArgs(long id)
id - idpublic String buildWhere(Set<Map.Entry<String,Object>> fields)
fields - fieldspublic String buildValueWhere(Set<Map.Entry<String,ColumnValue>> fields)
fields - fieldspublic String buildWhere(String field, Object value)
field - field namevalue - field valuepublic String buildWhereLike(String field, Object value)
field - field namevalue - field valuepublic String buildWhere(String field, Object value, String operation)
field - fieldvalue - valueoperation - operationpublic String buildWhere(String field, ColumnValue value)
field - field namevalue - column valuepublic String buildWhereLike(String field, ColumnValue value)
field - field namevalue - column valuepublic String[] buildWhereArgs(Collection<Object> values)
values - valuespublic String[] buildWhereArgs(Object[] values)
values - valuespublic String[] buildValueWhereArgs(Collection<ColumnValue> values)
values - valuespublic String[] buildWhereArgs(Object value)
value - valuepublic String[] buildWhereArgs(ColumnValue value)
value - valuepublic int count()
public int count(String where, String[] args)
where - where clauseargs - where argumentspublic Integer min(String column, String where, String[] args)
column - column namewhere - where clauseargs - where arugmentspublic Integer max(String column, String where, String[] args)
column - column namewhere - where clauseargs - where argumentspublic Object querySingleResult(String sql, String[] args)
sql - sql statementargs - sql argumentspublic <T> T querySingleTypedResult(String sql, String[] args)
T - result value typesql - sql statementargs - sql argumentspublic Object querySingleResult(String sql, String[] args, GeoPackageDataType dataType)
sql - sql statementargs - sql argumentsdataType - GeoPackage data typepublic <T> T querySingleTypedResult(String sql, String[] args, GeoPackageDataType dataType)
T - result value typesql - sql statementargs - sql argumentsdataType - GeoPackage data typepublic Object querySingleResult(String sql, String[] args, int column)
sql - sql statementargs - argumentscolumn - column indexpublic <T> T querySingleTypedResult(String sql, String[] args, int column)
T - result value typesql - sql statementargs - argumentscolumn - column indexpublic Object querySingleResult(String sql, String[] args, int column, GeoPackageDataType dataType)
sql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typepublic <T> T querySingleTypedResult(String sql, String[] args, int column, GeoPackageDataType dataType)
T - result value typesql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typepublic List<Object> querySingleColumnResults(String sql, String[] args)
sql - sql statementargs - sql argumentspublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args)
T - result value typesql - sql statementargs - sql argumentspublic List<Object> querySingleColumnResults(String sql, String[] args, GeoPackageDataType dataType)
sql - sql statementargs - argumentsdataType - GeoPackage data typepublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args, GeoPackageDataType dataType)
T - result value typesql - sql statementargs - argumentsdataType - GeoPackage data typepublic List<Object> querySingleColumnResults(String sql, String[] args, int column)
sql - sql statementargs - argumentscolumn - column indexpublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args, int column)
T - result value typesql - sql statementargs - argumentscolumn - column indexpublic List<Object> querySingleColumnResults(String sql, String[] args, int column, GeoPackageDataType dataType)
sql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typepublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args, int column, GeoPackageDataType dataType)
T - result value typesql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typepublic List<Object> querySingleColumnResults(String sql, String[] args, int column, Integer limit)
sql - sql statementargs - argumentslimit - result row limitcolumn - column indexpublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args, int column, Integer limit)
T - result value typesql - sql statementargs - argumentslimit - result row limitcolumn - column indexpublic List<Object> querySingleColumnResults(String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit)
sql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typelimit - result row limitpublic <T> List<T> querySingleColumnTypedResults(String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit)
T - result value typesql - sql statementargs - argumentscolumn - column indexdataType - GeoPackage data typelimit - result row limitpublic List<List<Object>> queryResults(String sql, String[] args)
sql - sql statementargs - argumentspublic <T> List<List<T>> queryTypedResults(String sql, String[] args)
T - result value typesql - sql statementargs - argumentspublic List<List<Object>> queryResults(String sql, String[] args, GeoPackageDataType[] dataTypes)
sql - sql statementargs - argumentsdataTypes - column data typespublic <T> List<List<T>> queryTypedResults(String sql, String[] args, GeoPackageDataType[] dataTypes)
T - result value typesql - sql statementargs - argumentsdataTypes - column data typespublic List<Object> querySingleRowResults(String sql, String[] args)
sql - sql statementargs - argumentspublic <T> List<T> querySingleRowTypedResults(String sql, String[] args)
T - result value typesql - sql statementargs - argumentspublic List<Object> querySingleRowResults(String sql, String[] args, GeoPackageDataType[] dataTypes)
sql - sql statementargs - argumentsdataTypes - column data typespublic <T> List<T> querySingleRowTypedResults(String sql, String[] args, GeoPackageDataType[] dataTypes)
T - result value typesql - sql statementargs - argumentsdataTypes - column data typespublic List<List<Object>> queryResults(String sql, String[] args, Integer limit)
sql - sql statementargs - argumentslimit - result row limitpublic <T> List<List<T>> queryTypedResults(String sql, String[] args, Integer limit)
T - result value typesql - sql statementargs - argumentslimit - result row limitpublic List<List<Object>> queryResults(String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit)
sql - sql statementargs - argumentsdataTypes - column data typeslimit - result row limitpublic <T> List<List<T>> queryTypedResults(String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit)
T - result value typesql - sql statementargs - argumentsdataTypes - column data typeslimit - result row limitpublic int getZoomLevel()
public String[] buildColumnsAsNull(List<TColumn> columns)
columns - columns to include as nullpublic String[] buildColumnsAs(List<TColumn> columns, String value)
columns - columns to include as valuevalue - "columns as" value for specified columnspublic String[] buildColumnsAsNull(String[] columns)
columns - columns to include as nullpublic String[] buildColumnsAs(String[] columns, String value)
columns - columns to include as valuevalue - "columns as" value for specified columnspublic String[] buildColumnsAs(List<TColumn> columns, String[] values)
columns - columns to include as valuevalues - "columns as" values for specified columnspublic String[] buildColumnsAs(String[] columns, String[] values)
columns - columns to include as valuevalues - "columns as" values for specified columnsCopyright © 2018 National Geospatial-Intelligence Agency. All rights reserved.