public class ManyManyLinkField extends AbstractLinkField
holder, hostField, linkedField, mapKey, target, targetType
构造器和说明 |
---|
ManyManyLinkField(Entity<?> host,
EntityHolder holder,
LinkInfo info) |
ManyManyLinkField(Entity<?> host,
EntityHolder holder,
LinkInfo info,
Class<?> klass,
String from,
String to,
String relation,
String key) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
_make(Entity<?> host,
String fromField,
String toField) |
Condition |
createCondition(Object host)
根据给定的宿主对象,以及自身记录的映射关系,生成一个获取映射对象的约束条件
`@One` 根据宿主对象引用字段值生成映射对象的条件语句
`@Many` 根据宿主对象主键值生成映射对象的条件语句
`@ManyMany` 根据宿主对象以及映射表生成映射对象的条件语句
|
String |
getFromColumnName() |
String[] |
getLinkedPkNames()
返回关联两个实体的主键 Java 字段名数组
数组的第一个元素是宿主主键的字段名,第二个元素是映射实体的主键字段名
|
LinkType |
getLinkType() |
String |
getRelationName() |
String |
getToColumnName() |
void |
saveLinkedField(Object obj,
Object linked)
用映射对象的字段更新宿主对象
|
void |
updateLinkedField(Object obj,
Object linked)
用宿主对象的字段更新映射对象
|
getCallback, getHostField, getLinkedEntity, getLinkedField, guessTargetClass, setValue
getEntity, getName, getType, getTypeClass, getTypeMirror, getValue, setEjecting, setInjecting, setName, setType, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEntity, getName, getType, getTypeClass, getTypeMirror, getValue
public ManyManyLinkField(Entity<?> host, EntityHolder holder, LinkInfo info, Class<?> klass, String from, String to, String relation, String key)
public ManyManyLinkField(Entity<?> host, EntityHolder holder, LinkInfo info)
public Condition createCondition(Object host)
LinkField
host
- 宿主对象public void updateLinkedField(Object obj, Object linked)
LinkField
obj
- 宿主对象linked
- 被映射的对象public void saveLinkedField(Object obj, Object linked)
LinkField
obj
- 宿主对象linked
- 被映射的对象public LinkType getLinkType()
public String getRelationName()
public String getFromColumnName()
public String getToColumnName()
public String[] getLinkedPkNames()
数组的第一个元素是宿主主键的字段名,第二个元素是映射实体的主键字段名
Copyright © 2017. All rights reserved.