程序包 cn.leancloud

类 LCRelation<T extends LCObject>


  • public class LCRelation<T extends LCObject>
    extends java.lang.Object
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void add​(T object)
      Adds an object to this relation.
      void addAll​(java.util.Collection<T> objects)
      Adds many objects to this relation.
      java.lang.String getKey()  
      LCObject getParent()  
      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.String getTargetClass()  
      void remove​(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.
      void setKey​(java.lang.String key)  
      void setParent​(LCObject parent)  
      void setTargetClass​(java.lang.String targetClass)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • 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 LCObjectLCQuery<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 name
        relationKey - The relation field key in parent
        child - The child object.
        返回:
        A AVQuery that restricts the results to parent objects in this relations.
      • reverseQuery

        public static <M extends LCObjectLCQuery<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 parent
        child - The child object.
        返回:
        A AVQuery that restricts the results to parent objects in this relations.