public class QuerySpec
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
QuerySpec.Order
Simple class to represent query order
|
static class |
QuerySpec.QueryType
Query type enum
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BEGIN_KEY |
java.lang.String |
beginKey |
java.lang.String |
countSmartSql |
static java.lang.String |
END_KEY |
java.lang.String |
endKey |
java.lang.String |
idsSmartSql |
static java.lang.String |
INDEX_PATH |
static java.lang.String |
LIKE_KEY |
java.lang.String |
likeKey |
static java.lang.String |
MATCH_KEY |
java.lang.String |
matchKey |
QuerySpec.Order |
order |
static java.lang.String |
ORDER |
static java.lang.String |
ORDER_PATH |
java.lang.String |
orderPath |
static java.lang.String |
PAGE_SIZE |
int |
pageSize |
java.lang.String |
path |
static java.lang.String |
QUERY_TYPE |
QuerySpec.QueryType |
queryType |
static java.lang.String |
SELECT_PATHS |
java.lang.String[] |
selectPaths |
static java.lang.String |
SMART_SQL |
java.lang.String |
smartSql |
java.lang.String |
soupName |
Modifier and Type | Method and Description |
---|---|
static QuerySpec |
buildAllQuerySpec(java.lang.String soupName,
java.lang.String[] selectPaths,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return query spec for an all query
|
static QuerySpec |
buildAllQuerySpec(java.lang.String soupName,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return query spec for an all query
|
static QuerySpec |
buildExactQuerySpec(java.lang.String soupName,
java.lang.String[] selectPaths,
java.lang.String path,
java.lang.String exactMatchKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for an exact match query
|
static QuerySpec |
buildExactQuerySpec(java.lang.String soupName,
java.lang.String path,
java.lang.String exactMatchKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for an exact match query
|
static QuerySpec |
buildLikeQuerySpec(java.lang.String soupName,
java.lang.String[] selectPaths,
java.lang.String path,
java.lang.String likeKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a like query
|
static QuerySpec |
buildLikeQuerySpec(java.lang.String soupName,
java.lang.String path,
java.lang.String likeKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a like query
|
static QuerySpec |
buildMatchQuerySpec(java.lang.String soupName,
java.lang.String[] selectPaths,
java.lang.String path,
java.lang.String matchKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a match query (full-text search)
|
static QuerySpec |
buildMatchQuerySpec(java.lang.String soupName,
java.lang.String path,
java.lang.String matchKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a match query (full-text search)
|
static QuerySpec |
buildRangeQuerySpec(java.lang.String soupName,
java.lang.String[] selectPaths,
java.lang.String path,
java.lang.String beginKey,
java.lang.String endKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a range query
|
static QuerySpec |
buildRangeQuerySpec(java.lang.String soupName,
java.lang.String path,
java.lang.String beginKey,
java.lang.String endKey,
java.lang.String orderPath,
QuerySpec.Order order,
int pageSize)
Return a query spec for a range query
|
static QuerySpec |
buildSmartQuerySpec(java.lang.String smartSql,
int pageSize)
Return a query spec for a smart query
|
static QuerySpec |
fromJSON(java.lang.String soupName,
JSONObject querySpecJson) |
java.lang.String[] |
getArgs() |
static java.lang.String |
qualifyMatchKey(java.lang.String field,
java.lang.String matchKey)
fts5 doesn't allow WHERE column MATCH 'value' - only allows WHERE table MATCH 'column:value'
This method changes the matchKey to add field: in the right places
|
public static final java.lang.String BEGIN_KEY
public static final java.lang.String END_KEY
public static final java.lang.String INDEX_PATH
public static final java.lang.String LIKE_KEY
public static final java.lang.String MATCH_KEY
public static final java.lang.String SMART_SQL
public static final java.lang.String ORDER_PATH
public static final java.lang.String ORDER
public static final java.lang.String PAGE_SIZE
public static final java.lang.String QUERY_TYPE
public static final java.lang.String SELECT_PATHS
public final QuerySpec.QueryType queryType
public final int pageSize
public final java.lang.String smartSql
public final java.lang.String countSmartSql
public final java.lang.String idsSmartSql
public final java.lang.String soupName
public final java.lang.String[] selectPaths
public final java.lang.String path
public final java.lang.String orderPath
public final QuerySpec.Order order
public final java.lang.String matchKey
public final java.lang.String beginKey
public final java.lang.String endKey
public final java.lang.String likeKey
public static QuerySpec buildAllQuerySpec(java.lang.String soupName, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- orderPath
- order
- pageSize
- public static QuerySpec buildAllQuerySpec(java.lang.String soupName, java.lang.String[] selectPaths, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- selectPaths
- orderPath
- order
- pageSize
- public static QuerySpec buildExactQuerySpec(java.lang.String soupName, java.lang.String path, java.lang.String exactMatchKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- path
- exactMatchKey
- orderPath
- order
- pageSize
- public static QuerySpec buildExactQuerySpec(java.lang.String soupName, java.lang.String[] selectPaths, java.lang.String path, java.lang.String exactMatchKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- selectPaths
- path
- exactMatchKey
- orderPath
- order
- pageSize
- public static QuerySpec buildRangeQuerySpec(java.lang.String soupName, java.lang.String path, java.lang.String beginKey, java.lang.String endKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- path
- beginKey
- endKey
- orderPath
- order
- pageSize
- public static QuerySpec buildRangeQuerySpec(java.lang.String soupName, java.lang.String[] selectPaths, java.lang.String path, java.lang.String beginKey, java.lang.String endKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- selectPaths
- path
- beginKey
- endKey
- orderPath
- order
- pageSize
- public static QuerySpec buildLikeQuerySpec(java.lang.String soupName, java.lang.String path, java.lang.String likeKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- path
- likeKey
- orderPath
- order
- pageSize
- public static QuerySpec buildLikeQuerySpec(java.lang.String soupName, java.lang.String[] selectPaths, java.lang.String path, java.lang.String likeKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- selectPaths
- path
- likeKey
- orderPath
- order
- pageSize
- public static QuerySpec buildMatchQuerySpec(java.lang.String soupName, java.lang.String path, java.lang.String matchKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- path
- matchKey
- orderPath
- order
- pageSize
- public static QuerySpec buildMatchQuerySpec(java.lang.String soupName, java.lang.String[] selectPaths, java.lang.String path, java.lang.String matchKey, java.lang.String orderPath, QuerySpec.Order order, int pageSize)
soupName
- selectPaths
- path
- matchKey
- orderPath
- order
- pageSize
- public static QuerySpec buildSmartQuerySpec(java.lang.String smartSql, int pageSize)
smartSql
- pageSize
- public static java.lang.String qualifyMatchKey(java.lang.String field, java.lang.String matchKey)
field
- matchKey
- public java.lang.String[] getArgs()
public static QuerySpec fromJSON(java.lang.String soupName, JSONObject querySpecJson) throws JSONException
soupName
- querySpecJson
- JSONException