Constructor and Description |
---|
LCRelation() |
LCRelation(LCObject parent,
String key) |
LCRelation(String targetClass) |
Modifier and Type | Method and Description |
---|---|
void |
add(T object)
Adds an object to this relation.
|
void |
addAll(Collection<T> objects)
Adds many objects to this relation.
|
String |
getKey() |
LCObject |
getParent() |
LCQuery<T> |
getQuery()
Gets a query that can be used to query the objects in this relation.
|
LCQuery<T> |
getQuery(Class<T> clazz)
Gets a query that can be used to query the subclass objects in this relation.
|
String |
getTargetClass() |
void |
remove(LCObject object)
Removes an object from this relation.
|
static <M extends LCObject> |
reverseQuery(Class<M> theParentClazz,
String relationKey,
LCObject child)
Create a query that can be used to query the parent objects in this relation.
|
static <M extends LCObject> |
reverseQuery(String parentClassName,
String relationKey,
LCObject child)
Create a query that can be used to query the parent objects in this relation.
|
void |
setKey(String key) |
void |
setParent(LCObject parent) |
void |
setTargetClass(String targetClass) |
public LCRelation()
public LCRelation(String targetClass)
public String getKey()
public void setKey(String key)
public LCObject getParent()
public void setParent(LCObject parent)
public String getTargetClass()
public void setTargetClass(String targetClass)
public void add(T object)
object
- The object to add to this relation.public void addAll(Collection<T> objects)
objects
- The objects to add to this relation.public void remove(LCObject object)
object
- The object to remove from this relation.public LCQuery<T> getQuery()
public LCQuery<T> getQuery(Class<T> clazz)
clazz
- The AVObject subclass.public static <M extends LCObject> LCQuery<M> reverseQuery(String parentClassName, String relationKey, LCObject child)
M
- template type.parentClassName
- The parent class namerelationKey
- The relation field key in parentchild
- The child object.public static <M extends LCObject> LCQuery<M> reverseQuery(Class<M> theParentClazz, String relationKey, LCObject child)
M
- template type.theParentClazz
- The parent subclass.relationKey
- The relation field key in parentchild
- The child object.Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.