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