]> source.dussan.org Git - iciql.git/commitdiff
Refactoring. 1/head
authorTaichi Uragami <backpaper0@gmail.com>
Fri, 6 Apr 2012 15:13:05 +0000 (00:13 +0900)
committerTaichi Uragami <backpaper0@gmail.com>
Fri, 6 Apr 2012 15:13:05 +0000 (00:13 +0900)
src/com/iciql/Query.java

index 9aefe27cdd22145928ce9abce9b84c8ebdcb706f..c2f81af2cb0434e236d077ac21125e92446d497f 100644 (file)
@@ -836,19 +836,18 @@ public class Query<T> {
         * @return the joined query\r
         */\r
 \r
-       @SuppressWarnings({ "unchecked", "rawtypes" })\r
        public <A> QueryJoin<T> innerJoin(A alias) {\r
-               TableDefinition<T> def = (TableDefinition<T>) db.define(alias.getClass());\r
-               SelectTable<T> join = new SelectTable(db, this, alias, false);\r
-               def.initSelectObject(join, alias, aliasMap);\r
-               joins.add(join);\r
-               return new QueryJoin(this, join);\r
+        return join(alias, false);\r
        }\r
 \r
-    @SuppressWarnings({ "unchecked", "rawtypes" })\r
     public <A> QueryJoin<T> leftJoin(A alias) {\r
+        return join(alias, true);\r
+    }\r
+\r
+    @SuppressWarnings({ "unchecked", "rawtypes" })\r
+    private <A> QueryJoin<T> join(A alias, boolean outerJoin) {\r
         TableDefinition<T> def = (TableDefinition<T>) db.define(alias.getClass());\r
-        SelectTable<T> join = new SelectTable(db, this, alias, true);\r
+        SelectTable<T> join = new SelectTable(db, this, alias, outerJoin);\r
         def.initSelectObject(join, alias, aliasMap);\r
         joins.add(join);\r
         return new QueryJoin(this, join);\r