This commit is contained in:
@@ -90,7 +90,7 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
}
|
}
|
||||||
final String jc = joinCol.column().isEmpty() ? secinfo.getPrimary().field() : joinCol.column();
|
final String jc = joinCol.column().isEmpty() ? secinfo.getPrimary().field() : joinCol.column();
|
||||||
if (first) {
|
if (first) {
|
||||||
joinsb.append(" ").append(joinCol.type().name()).append(" JOIN ").append(secinfo.getTable())
|
joinsb.append(" INNER JOIN ").append(secinfo.getTable())
|
||||||
.append(" ").append(alias).append(" ON ").append(secinfo.getSQLColumn("a", jc)).append(" = ").append(secinfo.getSQLColumn(alias, jc));
|
.append(" ").append(alias).append(" ON ").append(secinfo.getSQLColumn("a", jc)).append(" = ").append(secinfo.getSQLColumn(alias, jc));
|
||||||
}
|
}
|
||||||
newnode.foreignCache = secinfo.getCache();
|
newnode.foreignCache = secinfo.getCache();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import static java.lang.annotation.ElementType.FIELD;
|
|||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 只支持 INNER JOIN
|
||||||
*
|
*
|
||||||
* @author zhangjx
|
* @author zhangjx
|
||||||
*/
|
*/
|
||||||
@@ -19,11 +20,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
public @interface FilterJoinColumn {
|
public @interface FilterJoinColumn {
|
||||||
|
|
||||||
public enum JoinType { //不能支持RIGHT, 因为right获取的主对象都是null
|
|
||||||
|
|
||||||
LEFT, INNER;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联表 通常join表默认别名为b/c/d/...自增, 被join表默认别名为a
|
* 关联表 通常join表默认别名为b/c/d/...自增, 被join表默认别名为a
|
||||||
*
|
*
|
||||||
@@ -38,5 +34,4 @@ public @interface FilterJoinColumn {
|
|||||||
*/
|
*/
|
||||||
String column() default "";
|
String column() default "";
|
||||||
|
|
||||||
JoinType type() default JoinType.INNER;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user