@Documented @Retention(value=RUNTIME) @Target(value=FIELD) public @interface Fetch
| 限定符和类型 | 必需的元素和说明 |
|---|---|
Class |
target
目标,相当于表
|
String |
targetProperty
目标属性,相当于关联列 用于条件
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
column
Fetch列
column 和 property 二选一,column优先
|
boolean |
forceUseIn
强制使用in 查询,减少查询次数
|
String |
groupBy
用于查询group by 例如 "xx,xx2"; 其中 xx xx2 均为 实体类属性,不是列,多个逗号分割
可以动态 例如:[{id} desc,{createTime}]等
|
int |
limit
限制条数
|
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 String targetSelectProperty
public abstract String orderBy
public abstract String groupBy
public abstract boolean multiValueErrorIgnore
public abstract String nullFillValue
public abstract String otherConditions
Copyright © 2025. All rights reserved.