mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
feat: add extraCondition config for RelationToOne annotations, close #I88MJU
This commit is contained in:
parent
fa256234d1
commit
0d337e1032
@ -103,6 +103,12 @@ public @interface RelationManyToOne {
|
|||||||
*/
|
*/
|
||||||
String dataSource() default "";
|
String dataSource() default "";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询时,追加的额外条件。
|
||||||
|
*/
|
||||||
|
String extraCondition() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询(加载)指定的列
|
* 查询(加载)指定的列
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -103,6 +103,11 @@ public @interface RelationOneToOne {
|
|||||||
*/
|
*/
|
||||||
String dataSource() default "";
|
String dataSource() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询时,追加的额外条件。
|
||||||
|
*/
|
||||||
|
String extraCondition() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询(加载)指定的列
|
* 查询(加载)指定的列
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class ManyToOne<SelfEntity> extends ToOneRelation<SelfEntity> {
|
|||||||
, annotation.dataSource()
|
, annotation.dataSource()
|
||||||
, entityClass
|
, entityClass
|
||||||
, relationField
|
, relationField
|
||||||
|
, annotation.extraCondition()
|
||||||
, annotation.selectColumns());
|
, annotation.selectColumns());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class OneToOne<SelfEntity> extends ToOneRelation<SelfEntity> {
|
|||||||
, annotation.dataSource()
|
, annotation.dataSource()
|
||||||
, entityClass
|
, entityClass
|
||||||
, relationField
|
, relationField
|
||||||
|
, annotation.extraCondition()
|
||||||
, annotation.selectColumns());
|
, annotation.selectColumns());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,11 +26,12 @@ class ToOneRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
|
|||||||
|
|
||||||
public ToOneRelation(String selfField, String targetSchema, String targetTable, String targetField, String valueField,
|
public ToOneRelation(String selfField, String targetSchema, String targetTable, String targetField, String valueField,
|
||||||
String joinTable, String joinSelfColumn, String joinTargetColumn,
|
String joinTable, String joinSelfColumn, String joinTargetColumn,
|
||||||
String dataSource, Class<SelfEntity> selfEntityClass, Field relationField, String[] selectColumns) {
|
String dataSource, Class<SelfEntity> selfEntityClass, Field relationField,
|
||||||
|
String extraCondition,String[] selectColumns) {
|
||||||
super(selfField, targetSchema, targetTable, targetField, valueField,
|
super(selfField, targetSchema, targetTable, targetField, valueField,
|
||||||
joinTable, joinSelfColumn, joinTargetColumn,
|
joinTable, joinSelfColumn, joinTargetColumn,
|
||||||
dataSource, selfEntityClass, relationField,
|
dataSource, selfEntityClass, relationField,
|
||||||
null, selectColumns
|
extraCondition, selectColumns
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user