From: Taichi Uragami Date: Fri, 6 Apr 2012 15:13:05 +0000 (+0900) Subject: Refactoring. X-Git-Tag: v1.0.0~7^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1fcbeeb471ecde1b487bece52644ddc6713592ac;p=iciql.git Refactoring. --- diff --git a/src/com/iciql/Query.java b/src/com/iciql/Query.java index 9aefe27..c2f81af 100644 --- a/src/com/iciql/Query.java +++ b/src/com/iciql/Query.java @@ -836,19 +836,18 @@ public class Query { * @return the joined query */ - @SuppressWarnings({ "unchecked", "rawtypes" }) public QueryJoin innerJoin(A alias) { - TableDefinition def = (TableDefinition) db.define(alias.getClass()); - SelectTable join = new SelectTable(db, this, alias, false); - def.initSelectObject(join, alias, aliasMap); - joins.add(join); - return new QueryJoin(this, join); + return join(alias, false); } - @SuppressWarnings({ "unchecked", "rawtypes" }) public QueryJoin leftJoin(A alias) { + return join(alias, true); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + private QueryJoin join(A alias, boolean outerJoin) { TableDefinition def = (TableDefinition) db.define(alias.getClass()); - SelectTable join = new SelectTable(db, this, alias, true); + SelectTable join = new SelectTable(db, this, alias, outerJoin); def.initSelectObject(join, alias, aliasMap); joins.add(join); return new QueryJoin(this, join);