@Documented @Retention(value=RUNTIME) @Target(value=FIELD) public @interface Fetch
| 限定符和类型 | 必需的元素和说明 |
|---|---|
Class |
target
目标,相当于表
|
String |
targetProperty
目标属性,相当于关联列 用于条件
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
column
Fetch列
column 和 property 二选一,column优先
|
int |
limit
限制条数
|
Class |
middle
中间实体类(中间表)
|
String |
middleSourceProperty
中间实体类源属性(中间表与源表的列)
|
String |
middleTargetProperty
中间实体类目标属性(中间表与目标表的列)
|
boolean |
multiValueErrorIgnore
1 对 1 多条时,发现多条不报错
|
String |
nullFillValue
当值为null时,填充的值
|
String |
orderBy
用于结果排序 例如 "xx desc,xx2 desc"; 其中 xx xx2 均为 实体类属性,不是列,多个逗号分割
可以动态 例如:[{id} desc,{createTime} asc]等
|
String |
otherConditions
其他条件
|
String |
property
Fetch 源实体类的属性
property + source + storey 组合 用于获取列
|
Class |
source
Fetch property 对应的实体类
默认时:从当前作用域自动获取
|
int |
storey
存储层级
|
String |
targetSelectProperty
目标select属性
用于返回单列的情况
可以动态select 例如:[count({id})] or [{id}+{name} as aa]等
|
public abstract Class target
public abstract String targetProperty
public abstract String column
public abstract String property
public abstract Class source
public abstract Class middle
public abstract String middleSourceProperty
public abstract String middleTargetProperty
public abstract String targetSelectProperty
public abstract String orderBy
public abstract boolean multiValueErrorIgnore
public abstract String nullFillValue
public abstract String otherConditions
Copyright © 2025. All rights reserved.