From 1fcbeeb471ecde1b487bece52644ddc6713592ac Mon Sep 17 00:00:00 2001 From: Taichi Uragami Date: Sat, 7 Apr 2012 00:13:05 +0900 Subject: [PATCH] Refactoring. --- src/com/iciql/Query.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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); -- 2.39.5