tagList;
@RelationOneToMany(
selfField = "diseaseIds",
- selfFieldSplitBy = ",", //使用 , 进行分割
+ selfValueSplitBy = ",", //使用 "," 对 diseaseIds 的值进行分割
targetField = "diseaseId", //测试目标字段是字符串类型是否正常转换
mapKeyField = "diseaseId" //测试Map映射
)
@@ -291,7 +291,8 @@ public class PatientVO1 implements Serializable {
进行查询
```java
-PatientVO1 patientVO1 = patientMapper.selectOneWithRelationsByQueryAs(QueryWrapper.create().orderBy(PatientVO1::getPatientId, false).limit(1), PatientVO1.class);
+QueryWrapper qw = QueryWrapper.create().orderBy(PatientVO1::getPatientId, false).limit(1)
+PatientVO1 patientVO1 = patientMapper.selectOneWithRelationsByQueryAs(qw, PatientVO1.class);
System.out.println(JSON.toJSONString(patientVO1));
```
diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/RelationOneToMany.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/RelationOneToMany.java
index 969ec353..fae4a753 100644
--- a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/RelationOneToMany.java
+++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/RelationOneToMany.java
@@ -38,7 +38,7 @@ public @interface RelationOneToMany {
* 当前字段值根据字符串分割
* @return 分割字符串
*/
- String selfFieldSplitBy() default "";
+ String selfValueSplitBy() default "";
/**
*
diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/OneToMany.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/OneToMany.java
index 162c9caf..09f8d012 100644
--- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/OneToMany.java
+++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/OneToMany.java
@@ -35,7 +35,7 @@ class OneToMany extends ToManyRelation {
, annotation.extraCondition()
, annotation.selectColumns());
- this.selfFieldSplitBy = annotation.selfFieldSplitBy();
+ this.selfValueSplitBy = annotation.selfValueSplitBy();
this.orderBy = annotation.orderBy();
this.limit = annotation.limit();
diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/ToManyRelation.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/ToManyRelation.java
index d8e643bb..54840098 100644
--- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/ToManyRelation.java
+++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/ToManyRelation.java
@@ -29,7 +29,7 @@ class ToManyRelation extends AbstractRelation {
protected FieldWrapper mapKeyFieldWrapper;
protected String orderBy;
protected long limit = 0;
- protected String selfFieldSplitBy;
+ protected String selfValueSplitBy;
public ToManyRelation(String selfField, String targetSchema, String targetTable, String targetField, String valueField,
@@ -51,7 +51,7 @@ class ToManyRelation extends AbstractRelation {
*/
@Override
public QueryWrapper buildQueryWrapper(Set