程序包 cn.leancloud
类 LCQuery<T extends LCObject>
- java.lang.Object
-
- cn.leancloud.LCQuery<T>
-
- 所有已实现的接口:
java.lang.Cloneable
- 直接已知子类:
LCStatusQuery
public class LCQuery<T extends LCObject> extends java.lang.Object implements java.lang.Cloneable
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classLCQuery.CachePolicy
-
构造器概要
构造器 构造器 说明 LCQuery(java.lang.String theClassName)Constructs a query.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 LCQuery<T>addAscendingOrder(java.lang.String key)Also sorts the results in ascending order by the given key.LCQuery<T>addDescendingOrder(java.lang.String key)Also sorts the results in descending order by the given key.protected LCQuery<T>addWhereItem(java.lang.String key, java.lang.String op, java.lang.Object value)static <T extends LCObject>
LCQuery<T>and(java.util.List<LCQuery<T>> queries)Constructs a query that is the and of the given queries.protected java.util.Map<java.lang.String,java.lang.Object>assembleJsonParam()java.util.Map<java.lang.String,java.lang.String>assembleParameters()Assemble query parameters.static voidclearAllCachedResults()Clears the cached result for all queries.voidclearCachedResult()Removes the previously cached result for this query, forcing the next find() to hit the network.LCQueryclone()Clone a new query object, which fully same to this.intcount()Get result count in blocking mode.intcount(LCUser asAuthenticatedUser)Get result count in blocking mode.io.reactivex.Observable<java.lang.Integer>countInBackground()Get result count in async mode.io.reactivex.Observable<java.lang.Integer>countInBackground(LCUser asAuthenticatedUser)Get result count in async mode.voiddeleteAll()Delete all query result in blocking mode.voiddeleteAll(LCUser asAuthenticatedUser)Delete all query result in blocking mode.io.reactivex.Observable<LCNull>deleteAllInBackground()Delete all query result in async mode.io.reactivex.Observable<LCNull>deleteAllInBackground(LCUser asAuthenticatedUser)Delete all query result in async mode.java.util.List<T>find()Execute query in blocking mode.io.reactivex.Observable<java.util.List<T>>findInBackground()Execute query in async mode.io.reactivex.Observable<java.util.List<T>>findInBackground(LCUser asAuthenticatedUser)Execute query in async mode.protected io.reactivex.Observable<java.util.List<T>>findInBackground(LCUser asAuthenticatedUser, int explicitLimit)Tget(java.lang.String objectId)Get Object with specified objectId in blocking mode.LCQuery.CachePolicygetCachePolicy()Accessor for the caching policy.java.lang.StringgetClassName()Get class nameTgetFirst()Get first result in blocking mode.TgetFirst(LCUser asAuthenticatedUser)Get first result in blocking mode.io.reactivex.Observable<T>getFirstInBackground()Get first result in async mode.io.reactivex.Observable<T>getFirstInBackground(LCUser asAuthenticatedUser)Get first result in async mode.io.reactivex.Observable<T>getInBackground(LCUser asAuthenticatedUser, java.lang.String objectId)Get Object with specified objectId in async mode.io.reactivex.Observable<T>getInBackground(java.lang.String objectId)Get Object with specified objectId in async mode.intgetLimit()Accessor for the limit.longgetMaxCacheAge()Gets the maximum age of cached data that will be considered in this query.java.lang.StringgetOrder()Get order string.LCQuery.CachePolicygetPolicy()Get cache policy.static <T extends LCObject>
LCQuery<T>getQuery(java.lang.Class<T> clazz)Create a AVQuery with special sub-class.static <T extends LCObject>
LCQuery<T>getQuery(java.lang.String theClassName)Constructs a query.intgetSkip()Accessor for the skip value.booleanhasCachedResult()Has cached result or not.LCQuery<T>include(java.lang.String key)Include nested AVObjects for the provided key.LCQuery<T>includeACL(boolean includeACL)set include ACL or not.booleanisIncludeACL()Flag to indicate need ACL returned in result.LCQuery<T>limit(int limit)static <T extends LCObject>
LCQuery<T>or(java.util.List<LCQuery<T>> queries)Constructs a query that is the or of the given queries.LCQuery<T>order(java.lang.String order)LCQuery<T>orderByAscending(java.lang.String key)Sorts the results in ascending order by the given key.LCQuery<T>orderByDescending(java.lang.String key)Sorts the results in descending order by the given key.LCQuery<T>selectKeys(java.util.Collection<java.lang.String> keys)Restrict the fields of returned AVObjects to only include the provided keys.LCQuery<T>setCachePolicy(LCQuery.CachePolicy cachePolicy)Change the caching policy of this query.LCQuery<T>setClassName(java.lang.String className)Set class nameLCQuery<T>setLimit(int limit)Controls the maximum number of results that are returned.LCQuery<T>setMaxCacheAge(long maxCacheAge)Sets the maximum age of cached data that will be considered in this query.LCQuery<T>setOrder(java.lang.String order)Set query order fields.LCQuery<T>setPolicy(LCQuery.CachePolicy policy)Change the caching policy of this query.LCQuery<T>setSkip(int skip)Controls the number of results to skip before returning any results.LCQuery<T>skip(int skip)LCQuery<T>whereContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> values)Add a constraint to the query that requires a particular key's value to be contained in the provided list of values.LCQuery<T>whereContains(java.lang.String key, java.lang.String substring)Add a constraint for finding string values that contain a provided string.LCQuery<T>whereContainsAll(java.lang.String key, java.util.Collection<?> values)Add a constraint to the query that requires a particular key's value match another AVQuery.LCQuery<T>whereDoesNotExist(java.lang.String key)Add a constraint for finding objects that do not contain a given key.LCQuery<T>whereDoesNotMatchKeyInQuery(java.lang.String key, java.lang.String keyInQuery, LCQuery<?> query)Add a constraint to the query that requires a particular key's value does not match any value for a key in the results of another AVQuery.LCQuery<T>whereDoesNotMatchQuery(java.lang.String key, LCQuery<?> query)Add a constraint to the query that requires a particular key's value does not match another AVQuery.LCQuery<T>whereEndsWith(java.lang.String key, java.lang.String suffix)Add a constraint for finding string values that end with a provided string.LCQuery<T>whereEqualTo(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be equal to the provided value.LCQuery<T>whereExists(java.lang.String key)Add a constraint for finding objects that contain the given key.LCQuery<T>whereGreaterThan(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be greater than the provided value. wLCQuery<T>whereGreaterThanOrEqualTo(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be greater or equal to than the provided value.LCQuery<T>whereLessThan(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be less than the provided value.LCQuery<T>whereLessThanOrEqualTo(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be less or equal to than the provided value.LCQuery<T>whereMatches(java.lang.String key, java.lang.String regex)Add a regular expression constraint for finding string values that match the provided regular expression.LCQuery<T>whereMatches(java.lang.String key, java.lang.String regex, java.lang.String modifiers)Add a regular expression constraint for finding string values that match the provided regular expression.LCQuery<T>whereMatchesKeyInQuery(java.lang.String key, java.lang.String keyInQuery, LCQuery<?> query)Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another AVQueryLCQuery<T>whereMatchesQuery(java.lang.String key, LCQuery<?> query)Add a constraint to the query that requires a particular key's value match another AVQuery.LCQuery<T>whereNear(java.lang.String key, LCGeoPoint point)Add a proximity based constraint for finding objects with key point values near the point given.LCQuery<T>whereNotContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> values)Add a constraint to the query that requires a particular key's value not be contained in the provided list of values.LCQuery<T>whereNotEqualTo(java.lang.String key, java.lang.Object value)Add a constraint to the query that requires a particular key's value to be not equal to the provided value.LCQuery<T>whereSizeEqual(java.lang.String key, int size)添加查询约束条件,查找key类型是数组,该数组的长度匹配提供的数值。LCQuery<T>whereStartsWith(java.lang.String key, java.lang.String prefix)Add a constraint for finding string values that start with a provided string.LCQuery<T>whereWithinGeoBox(java.lang.String key, LCGeoPoint southwest, LCGeoPoint northeast)Add a constraint to the query that requires a particular key's coordinates be contained within a given rectangular geographic bounding box.LCQuery<T>whereWithinKilometers(java.lang.String key, LCGeoPoint point, double maxDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.LCQuery<T>whereWithinKilometers(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the given ring area Radius of earth used is 6371.0 kilometers.LCQuery<T>whereWithinMiles(java.lang.String key, LCGeoPoint point, double maxDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.LCQuery<T>whereWithinMiles(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the given ring.LCQuery<T>whereWithinRadians(java.lang.String key, LCGeoPoint point, double maxDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.LCQuery<T>whereWithinRadians(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.
-
-
-
方法详细资料
-
clone
public LCQuery clone() throws java.lang.CloneNotSupportedException
Clone a new query object, which fully same to this.- 覆盖:
clone在类中java.lang.Object- 返回:
- a new AVQuery object.
- 抛出:
java.lang.CloneNotSupportedException
-
getQuery
public static <T extends LCObject> LCQuery<T> getQuery(java.lang.String theClassName)
Constructs a query. A default query with no further parameters will retrieve all AVObjects of the provided class.- 类型参数:
T- template type.- 参数:
theClassName- The name of the class to retrieve AVObjects for.- 返回:
- the query object.
-
getQuery
public static <T extends LCObject> LCQuery<T> getQuery(java.lang.Class<T> clazz)
Create a AVQuery with special sub-class.- 类型参数:
T- template type.- 参数:
clazz- The AVObject subclass- 返回:
- The AVQuery
-
getClassName
public java.lang.String getClassName()
Get class name- 返回:
- class name.
-
setClassName
public LCQuery<T> setClassName(java.lang.String className)
Set class name- 参数:
className- class name.- 返回:
- current instance.
-
getCachePolicy
public LCQuery.CachePolicy getCachePolicy()
Accessor for the caching policy.- 返回:
- cache policy
-
setCachePolicy
public LCQuery<T> setCachePolicy(LCQuery.CachePolicy cachePolicy)
Change the caching policy of this query.- 参数:
cachePolicy- cache policy.- 返回:
- this query.
-
getPolicy
public LCQuery.CachePolicy getPolicy()
Get cache policy.- 返回:
- cache policy.
-
setPolicy
public LCQuery<T> setPolicy(LCQuery.CachePolicy policy)
Change the caching policy of this query.- 参数:
policy- cache policy.- 返回:
- this query.
-
getMaxCacheAge
public long getMaxCacheAge()
Gets the maximum age of cached data that will be considered in this query. The returned value is in milliseconds- 返回:
- max cache age(milliseconds).
-
setMaxCacheAge
public LCQuery<T> setMaxCacheAge(long maxCacheAge)
Sets the maximum age of cached data that will be considered in this query.- 参数:
maxCacheAge- mac cached age.- 返回:
- this query.
-
clearAllCachedResults
public static void clearAllCachedResults()
Clears the cached result for all queries.
-
clearCachedResult
public void clearCachedResult()
Removes the previously cached result for this query, forcing the next find() to hit the network. If there is no cached result for this query, then this is a no-op.
-
getLimit
public int getLimit()
Accessor for the limit.- 返回:
- query limit.
-
setLimit
public LCQuery<T> setLimit(int limit)
Controls the maximum number of results that are returned. Setting a negative limit denotes retrieval without a limit. The default limit is 100, with a maximum of 1000 results being returned at a time.- 参数:
limit- query limit.- 返回:
- this query.
-
limit
public LCQuery<T> limit(int limit)
- 参数:
limit- query limit- 返回:
- this query.
- 另请参阅:
setLimit(int)
-
skip
public LCQuery<T> skip(int skip)
- 参数:
skip- qury skip- 返回:
- this query.
- 另请参阅:
setSkip(int)
-
getSkip
public int getSkip()
Accessor for the skip value.- 返回:
- current skip value.
-
setSkip
public LCQuery<T> setSkip(int skip)
Controls the number of results to skip before returning any results. This is useful for pagination. Default is to skip zero results.- 参数:
skip- query skip.- 返回:
- this query
-
getOrder
public java.lang.String getOrder()
Get order string.- 返回:
- order string.
-
setOrder
public LCQuery<T> setOrder(java.lang.String order)
Set query order fields.- 参数:
order- order string.- 返回:
- this query.
-
order
public LCQuery<T> order(java.lang.String order)
- 参数:
order- order string.- 返回:
- this query.
- 另请参阅:
setOrder(String)
-
addAscendingOrder
public LCQuery<T> addAscendingOrder(java.lang.String key)
Also sorts the results in ascending order by the given key. The previous sort keys have precedence over this key.- 参数:
key- The key to order by- 返回:
- Returns the query so you can chain this call.
-
addDescendingOrder
public LCQuery<T> addDescendingOrder(java.lang.String key)
Also sorts the results in descending order by the given key. The previous sort keys have precedence over this key.- 参数:
key- The key to order by- 返回:
- Returns the query so you can chain this call.
-
isIncludeACL
public boolean isIncludeACL()
Flag to indicate need ACL returned in result.- 返回:
- include flag.
-
includeACL
public LCQuery<T> includeACL(boolean includeACL)
set include ACL or not.- 参数:
includeACL- Flag to indicate need ACL returned in result.- 返回:
- this query.
-
include
public LCQuery<T> include(java.lang.String key)
Include nested AVObjects for the provided key. You can use dot notation to specify which fields in the included object that are also fetched.- 参数:
key- The key that should be included.- 返回:
- this query.
-
selectKeys
public LCQuery<T> selectKeys(java.util.Collection<java.lang.String> keys)
Restrict the fields of returned AVObjects to only include the provided keys. If this is called multiple times, then all of the keys specified in each of the calls will be included.- 参数:
keys- The set of keys to include in the result.- 返回:
- this query.
-
orderByAscending
public LCQuery<T> orderByAscending(java.lang.String key)
Sorts the results in ascending order by the given key.- 参数:
key- The key to order by.- 返回:
- Returns the query, so you can chain this call.
-
orderByDescending
public LCQuery<T> orderByDescending(java.lang.String key)
Sorts the results in descending order by the given key.- 参数:
key- The key to order by.- 返回:
- Returns the query, so you can chain this call.
-
whereContainedIn
public LCQuery<T> whereContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> values)
Add a constraint to the query that requires a particular key's value to be contained in the provided list of values.- 参数:
key- The key to check.values- The values that will match.- 返回:
- Returns the query, so you can chain this call.
-
whereContains
public LCQuery<T> whereContains(java.lang.String key, java.lang.String substring)
Add a constraint for finding string values that contain a provided string. This will be slow for large datasets.- 参数:
key- The key that the string to match is stored in.substring- The substring that the value must contain.- 返回:
- Returns the query, so you can chain this call.
-
whereSizeEqual
public LCQuery<T> whereSizeEqual(java.lang.String key, int size)
添加查询约束条件,查找key类型是数组,该数组的长度匹配提供的数值。- 参数:
key- 查询的keysize- 数组的长度- 返回:
- this query.
- 从以下版本开始:
- 2.0.2
-
whereContainsAll
public LCQuery<T> whereContainsAll(java.lang.String key, java.util.Collection<?> values)
Add a constraint to the query that requires a particular key's value match another AVQuery. This only works on keys whose values are AVObjects or lists of AVObjects. Add a constraint to the query that requires a particular key's value to contain every one of the provided list of values.- 参数:
key- The key to check. This key's value must be an array.values- The values that will match.- 返回:
- Returns the query, so you can chain this call.
-
whereDoesNotExist
public LCQuery<T> whereDoesNotExist(java.lang.String key)
Add a constraint for finding objects that do not contain a given key.- 参数:
key- The key that should not exist- 返回:
- this query.
-
whereEndsWith
public LCQuery<T> whereEndsWith(java.lang.String key, java.lang.String suffix)
Add a constraint for finding string values that end with a provided string. This will be slow for large datasets.- 参数:
key- The key that the string to match is stored in.suffix- The substring that the value must end with.- 返回:
- Returns the query, so you can chain this call.
-
whereEqualTo
public LCQuery<T> whereEqualTo(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be equal to the provided value.- 参数:
key- The key to check.value- The value that the AVObject must contain.- 返回:
- Returns the query, so you can chain this call.
-
addWhereItem
protected LCQuery<T> addWhereItem(java.lang.String key, java.lang.String op, java.lang.Object value)
-
whereExists
public LCQuery<T> whereExists(java.lang.String key)
Add a constraint for finding objects that contain the given key.- 参数:
key- The key that should exist.- 返回:
- this query.
-
whereGreaterThan
public LCQuery<T> whereGreaterThan(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be greater than the provided value. w- 参数:
key- The key to check.value- The value that provides an lower bound.- 返回:
- Returns the query, so you can chain this call.
-
whereGreaterThanOrEqualTo
public LCQuery<T> whereGreaterThanOrEqualTo(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be greater or equal to than the provided value.- 参数:
key- The key to check.value- The value that provides an lower bound.- 返回:
- Returns the query, so you can chain this call.
-
whereLessThan
public LCQuery<T> whereLessThan(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be less than the provided value.- 参数:
key- The key to check.value- The value that provides an upper bound.- 返回:
- Returns the query, so you can chain this call.
-
whereLessThanOrEqualTo
public LCQuery<T> whereLessThanOrEqualTo(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be less or equal to than the provided value.- 参数:
key- The key to check.value- The value that provides an lower bound.- 返回:
- Returns the query, so you can chain this call.
-
whereMatches
public LCQuery<T> whereMatches(java.lang.String key, java.lang.String regex)
Add a regular expression constraint for finding string values that match the provided regular expression. This may be slow for large datasets.- 参数:
key- The key that the string to match is stored in.regex- The regular expression pattern to match.- 返回:
- Returns the query, so you can chain this call.
-
whereMatches
public LCQuery<T> whereMatches(java.lang.String key, java.lang.String regex, java.lang.String modifiers)
Add a regular expression constraint for finding string values that match the provided regular expression. This may be slow for large datasets.- 参数:
key- The key that the string to match is stored in.regex- The regular expression pattern to match.modifiers- Any of the following supported PCRE modifiers: i - Case insensitive search m - Search across multiple lines of input- 返回:
- this query.
-
whereNear
public LCQuery<T> whereNear(java.lang.String key, LCGeoPoint point)
Add a proximity based constraint for finding objects with key point values near the point given.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.- 返回:
- Returns the query, so you can chain this call.
-
whereNotContainedIn
public LCQuery<T> whereNotContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> values)
Add a constraint to the query that requires a particular key's value not be contained in the provided list of values.- 参数:
key- The key to check.values- The values that will not match.- 返回:
- Returns the query, so you can chain this call.
-
whereNotEqualTo
public LCQuery<T> whereNotEqualTo(java.lang.String key, java.lang.Object value)
Add a constraint to the query that requires a particular key's value to be not equal to the provided value.- 参数:
key- The key to check.value- The value that must not be equalled.- 返回:
- Returns the query, so you can chain this call.
-
whereStartsWith
public LCQuery<T> whereStartsWith(java.lang.String key, java.lang.String prefix)
Add a constraint for finding string values that start with a provided string. This query will use the backend index, so it will be fast even for large datasets.- 参数:
key- The key that the string to match is stored in.prefix- The substring that the value must start with.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinGeoBox
public LCQuery<T> whereWithinGeoBox(java.lang.String key, LCGeoPoint southwest, LCGeoPoint northeast)
Add a constraint to the query that requires a particular key's coordinates be contained within a given rectangular geographic bounding box.- 参数:
key- The key to be constrained.southwest- The lower-left inclusive corner of the box.northeast- The upper-right inclusive corner of the box.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinKilometers
public LCQuery<T> whereWithinKilometers(java.lang.String key, LCGeoPoint point, double maxDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given. Radius of earth used is 6371.0 kilometers.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.maxDistance- Maximum distance (in kilometers) of results to return.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinKilometers
public LCQuery<T> whereWithinKilometers(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the given ring area Radius of earth used is 6371.0 kilometers.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.maxDistance- outer radius of the given ring in kilometersminDistance- inner radius of the given ring in kilometers- 返回:
- Returns the query, so you can chain this call.
-
whereWithinMiles
public LCQuery<T> whereWithinMiles(java.lang.String key, LCGeoPoint point, double maxDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given. Radius of earth used is 3958.8 miles.- 参数:
key- The key that the AVGeoPoint is stored in.maxDistance- outer radius of the given ring in miles.point- The reference AVGeoPoint that is used.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinMiles
public LCQuery<T> whereWithinMiles(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the given ring. Radius of earth used is 3958.8 miles.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.maxDistance- outer radius of the given ring in miles.minDistance- inner radius of the given ring in miles.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinRadians
public LCQuery<T> whereWithinRadians(java.lang.String key, LCGeoPoint point, double maxDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.maxDistance- Maximum distance (in radians) of results to return.- 返回:
- Returns the query, so you can chain this call.
-
whereWithinRadians
public LCQuery<T> whereWithinRadians(java.lang.String key, LCGeoPoint point, double maxDistance, double minDistance)
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.- 参数:
key- The key that the AVGeoPoint is stored in.point- The reference AVGeoPoint that is used.maxDistance- outer radius of the given radians.minDistance- inner radius of the given radians.- 返回:
- Returns the query, so you can chain this call.
-
whereMatchesKeyInQuery
public LCQuery<T> whereMatchesKeyInQuery(java.lang.String key, java.lang.String keyInQuery, LCQuery<?> query)
Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another AVQuery- 参数:
key- The key whose value is being checkedkeyInQuery- The key in the objects from the sub query to look inquery- The sub query to run- 返回:
- Returns the query so you can chain this call.
-
whereMatchesQuery
public LCQuery<T> whereMatchesQuery(java.lang.String key, LCQuery<?> query)
Add a constraint to the query that requires a particular key's value match another AVQuery. This only works on keys whose values are AVObjects or lists of AVObjects.- 参数:
key- The key to check.query- The query that the value should match- 返回:
- Returns the query so you can chain this call.
-
whereDoesNotMatchKeyInQuery
public LCQuery<T> whereDoesNotMatchKeyInQuery(java.lang.String key, java.lang.String keyInQuery, LCQuery<?> query)
Add a constraint to the query that requires a particular key's value does not match any value for a key in the results of another AVQuery.- 参数:
key- The key whose value is being checked and excludedkeyInQuery- The key in the objects from the sub query to look inquery- The sub query to run- 返回:
- Returns the query so you can chain this call.
-
whereDoesNotMatchQuery
public LCQuery<T> whereDoesNotMatchQuery(java.lang.String key, LCQuery<?> query)
Add a constraint to the query that requires a particular key's value does not match another AVQuery. This only works on keys whose values are AVObjects or lists of AVObjects.- 参数:
key- The key to check.query- The query that the value should not match- 返回:
- Returns the query so you can chain this call.
-
or
public static <T extends LCObject> LCQuery<T> or(java.util.List<LCQuery<T>> queries)
Constructs a query that is the or of the given queries.- 类型参数:
T- template type.- 参数:
queries- The list of AVQueries to 'or' together- 返回:
- A AVQuery that is the 'or' of the passed in queries
-
and
public static <T extends LCObject> LCQuery<T> and(java.util.List<LCQuery<T>> queries)
Constructs a query that is the and of the given queries.- 类型参数:
T- template type.- 参数:
queries- The list of AVQueries to 'and' together- 返回:
- A AVQuery that is the 'and' of the passed in queries
-
hasCachedResult
public boolean hasCachedResult()
Has cached result or not.- 返回:
- cache result existed or not.
-
find
public java.util.List<T> find()
Execute query in blocking mode.- 返回:
- result of list.
-
findInBackground
public io.reactivex.Observable<java.util.List<T>> findInBackground()
Execute query in async mode.- 返回:
- observable instance.
-
findInBackground
public io.reactivex.Observable<java.util.List<T>> findInBackground(LCUser asAuthenticatedUser)
Execute query in async mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- observable instance. in general, this method should be invoked in lean engine.
-
findInBackground
protected io.reactivex.Observable<java.util.List<T>> findInBackground(LCUser asAuthenticatedUser, int explicitLimit)
-
get
public T get(java.lang.String objectId)
Get Object with specified objectId in blocking mode.- 参数:
objectId- object id.- 返回:
- object instance.
-
getInBackground
public io.reactivex.Observable<T> getInBackground(java.lang.String objectId)
Get Object with specified objectId in async mode.- 参数:
objectId- object id.- 返回:
- observable instance.
-
getInBackground
public io.reactivex.Observable<T> getInBackground(LCUser asAuthenticatedUser, java.lang.String objectId)
Get Object with specified objectId in async mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.objectId- object id.- 返回:
- observable instance. in general, this method should be invoked in lean engine.
-
getFirst
public T getFirst()
Get first result in blocking mode.- 返回:
- first result.
-
getFirst
public T getFirst(LCUser asAuthenticatedUser)
Get first result in blocking mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- first result. in general, this method should be invoked in lean engine.
-
getFirstInBackground
public io.reactivex.Observable<T> getFirstInBackground()
Get first result in async mode.- 返回:
- observable instance.
-
getFirstInBackground
public io.reactivex.Observable<T> getFirstInBackground(LCUser asAuthenticatedUser)
Get first result in async mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- observable instance. in general, this method should be invoked in lean engine.
-
count
public int count()
Get result count in blocking mode.- 返回:
- result count.
-
count
public int count(LCUser asAuthenticatedUser)
Get result count in blocking mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- result count. in general, this method should be invoked in lean engine.
-
countInBackground
public io.reactivex.Observable<java.lang.Integer> countInBackground()
Get result count in async mode.- 返回:
- observable instance.
-
countInBackground
public io.reactivex.Observable<java.lang.Integer> countInBackground(LCUser asAuthenticatedUser)
Get result count in async mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- observable instance. in general, this method should be invoked in lean engine.
-
deleteAll
public void deleteAll()
Delete all query result in blocking mode.
-
deleteAll
public void deleteAll(LCUser asAuthenticatedUser)
Delete all query result in blocking mode.- 参数:
asAuthenticatedUser- explicit user for request authentication. in general, this method should be invoked in lean engine.
-
deleteAllInBackground
public io.reactivex.Observable<LCNull> deleteAllInBackground()
Delete all query result in async mode.- 返回:
- observable instance.
-
deleteAllInBackground
public io.reactivex.Observable<LCNull> deleteAllInBackground(LCUser asAuthenticatedUser)
Delete all query result in async mode.- 参数:
asAuthenticatedUser- explicit user for request authentication.- 返回:
- observable instance. in general, this method should be invoked in lean engine.
-
assembleParameters
public java.util.Map<java.lang.String,java.lang.String> assembleParameters()
Assemble query parameters.- 返回:
- map of query parameters.
-
assembleJsonParam
protected java.util.Map<java.lang.String,java.lang.Object> assembleJsonParam()
-
-