Package cn.leancloud
Class LCRelation<T extends LCObject>
java.lang.Object
cn.leancloud.LCRelation<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an object to this relation.voidaddAll(Collection<T> objects) Adds many objects to this relation.getKey()getQuery()Gets a query that can be used to query the objects in this relation.Gets a query that can be used to query the subclass objects in this relation.voidRemoves an object from this relation.reverseQuery(Class<M> theParentClazz, String relationKey, LCObject child) Create a query that can be used to query the parent objects in this relation.reverseQuery(String parentClassName, String relationKey, LCObject child) Create a query that can be used to query the parent objects in this relation.voidvoidvoidsetTargetClass(String targetClass)
-
Constructor Details
-
LCRelation
public LCRelation() -
LCRelation
-
LCRelation
-
-
Method Details
-
getKey
-
setKey
-
getParent
-
setParent
-
getTargetClass
-
setTargetClass
-
add
Adds an object to this relation.- Parameters:
object- The object to add to this relation.
-
addAll
Adds many objects to this relation.- Parameters:
objects- The objects to add to this relation.
-
remove
Removes an object from this relation.- Parameters:
object- The object to remove from this relation.
-
getQuery
Gets a query that can be used to query the objects in this relation.- Returns:
- A AVQuery that restricts the results to objects in this relations.
-
getQuery
Gets a query that can be used to query the subclass objects in this relation.- Parameters:
clazz- The AVObject subclass.- Returns:
- A AVQuery that restricts the results to objects in this relations.
-
reverseQuery
public static <M extends LCObject> LCQuery<M> reverseQuery(String parentClassName, String relationKey, LCObject child) Create a query that can be used to query the parent objects in this relation.- Type Parameters:
M- template type.- Parameters:
parentClassName- The parent class namerelationKey- The relation field key in parentchild- The child object.- Returns:
- A AVQuery that restricts the results to parent objects in this relations.
-
reverseQuery
public static <M extends LCObject> LCQuery<M> reverseQuery(Class<M> theParentClazz, String relationKey, LCObject child) Create a query that can be used to query the parent objects in this relation.- Type Parameters:
M- template type.- Parameters:
theParentClazz- The parent subclass.relationKey- The relation field key in parentchild- The child object.- Returns:
- A AVQuery that restricts the results to parent objects in this relations.
-