This commit is contained in:
kamhung
2015-12-03 15:56:51 +08:00
parent 1d1f41613a
commit d5c0ff1e8a
2 changed files with 2 additions and 7 deletions

View File

@@ -90,7 +90,7 @@ final class FilterBeanNode extends FilterNode {
}
final String jc = joinCol.column().isEmpty() ? secinfo.getPrimary().field() : joinCol.column();
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));
}
newnode.foreignCache = secinfo.getCache();

View File

@@ -10,6 +10,7 @@ import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 只支持 INNER JOIN
*
* @author zhangjx
*/
@@ -19,11 +20,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
public @interface FilterJoinColumn {
public enum JoinType { //不能支持RIGHT 因为right获取的主对象都是null
LEFT, INNER;
}
/**
* 关联表 通常join表默认别名为b/c/d/...自增, 被join表默认别名为a
*
@@ -38,5 +34,4 @@ public @interface FilterJoinColumn {
*/
String column() default "";
JoinType type() default JoinType.INNER;
}