@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
@Documented
public @interface ManyMany
限定符和类型 | 必需的元素和说明 |
---|---|
java.lang.String |
from
关联表中哪个字段代表主对象, 如果你想指定 java 字段的名字,可以用冒号分隔 即
uid:userId
来指定宿主对象的 "userId" 字段对应数据表的 "uid" 字段。
|
java.lang.String |
relation
中间表的名称
|
java.lang.Class<?> |
target
关联类
|
java.lang.String |
to
关联表中哪个字段代表 target 对象, 如果你想指定 java 字段的名字,可以用冒号分隔 即
pid:petId
来指定 target 对象的 "petId" 字段对应数据表的 "pid" 字段。
|
public abstract java.lang.String from
uid:userId来指定宿主对象的 "userId" 字段对应数据表的 "uid" 字段。 如果没有 ":",则宿主 Java 字段需要与数据表字段同名
public abstract java.lang.String to
pid:petId来指定 target 对象的 "petId" 字段对应数据表的 "pid" 字段。 如果没有 ":",则 target 对象 Java 字段需要与数据表字段同名
public abstract java.lang.String key
from()
的类型选取@Id或者@Name等主键字段