程序包 cn.leancloud
类 LCRelation<T extends LCObject>
- java.lang.Object
-
- cn.leancloud.LCRelation<T>
-
public class LCRelation<T extends LCObject> extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 LCRelation()LCRelation(LCObject parent, java.lang.String key)LCRelation(java.lang.String targetClass)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadd(T object)Adds an object to this relation.voidaddAll(java.util.Collection<T> objects)Adds many objects to this relation.java.lang.StringgetKey()LCObjectgetParent()LCQuery<T>getQuery()Gets a query that can be used to query the objects in this relation.LCQuery<T>getQuery(java.lang.Class<T> clazz)Gets a query that can be used to query the subclass objects in this relation.java.lang.StringgetTargetClass()voidremove(LCObject object)Removes an object from this relation.static <M extends LCObject>
LCQuery<M>reverseQuery(java.lang.Class<M> theParentClazz, java.lang.String relationKey, LCObject child)Create a query that can be used to query the parent objects in this relation.static <M extends LCObject>
LCQuery<M>reverseQuery(java.lang.String parentClassName, java.lang.String relationKey, LCObject child)Create a query that can be used to query the parent objects in this relation.voidsetKey(java.lang.String key)voidsetParent(LCObject parent)voidsetTargetClass(java.lang.String targetClass)
-
-
-
构造器详细资料
-
LCRelation
public LCRelation()
-
LCRelation
public LCRelation(LCObject parent, java.lang.String key)
-
LCRelation
public LCRelation(java.lang.String targetClass)
-
-
方法详细资料
-
getKey
public java.lang.String getKey()
-
setKey
public void setKey(java.lang.String key)
-
getParent
public LCObject getParent()
-
setParent
public void setParent(LCObject parent)
-
getTargetClass
public java.lang.String getTargetClass()
-
setTargetClass
public void setTargetClass(java.lang.String targetClass)
-
add
public void add(T object)
Adds an object to this relation.- 参数:
object- The object to add to this relation.
-
addAll
public void addAll(java.util.Collection<T> objects)
Adds many objects to this relation.- 参数:
objects- The objects to add to this relation.
-
remove
public void remove(LCObject object)
Removes an object from this relation.- 参数:
object- The object to remove from this relation.
-
getQuery
public LCQuery<T> getQuery()
Gets a query that can be used to query the objects in this relation.- 返回:
- A AVQuery that restricts the results to objects in this relations.
-
getQuery
public LCQuery<T> getQuery(java.lang.Class<T> clazz)
Gets a query that can be used to query the subclass objects in this relation.- 参数:
clazz- The AVObject subclass.- 返回:
- A AVQuery that restricts the results to objects in this relations.
-
reverseQuery
public static <M extends LCObject> LCQuery<M> reverseQuery(java.lang.String parentClassName, java.lang.String relationKey, LCObject child)
Create a query that can be used to query the parent objects in this relation.- 类型参数:
M- template type.- 参数:
parentClassName- The parent class namerelationKey- The relation field key in parentchild- The child object.- 返回:
- A AVQuery that restricts the results to parent objects in this relations.
-
reverseQuery
public static <M extends LCObject> LCQuery<M> reverseQuery(java.lang.Class<M> theParentClazz, java.lang.String relationKey, LCObject child)
Create a query that can be used to query the parent objects in this relation.- 类型参数:
M- template type.- 参数:
theParentClazz- The parent subclass.relationKey- The relation field key in parentchild- The child object.- 返回:
- A AVQuery that restricts the results to parent objects in this relations.
-
-