diff options
author | Taichi Uragami <backpaper0@gmail.com> | 2012-04-07 00:13:05 +0900 |
---|---|---|
committer | Taichi Uragami <backpaper0@gmail.com> | 2012-04-07 00:13:05 +0900 |
commit | 1fcbeeb471ecde1b487bece52644ddc6713592ac (patch) | |
tree | 146a136c4be850ff40d0e7cd6db95c0b42079bcb | |
parent | cb29e503658e2a3339c265651a869fcbe0d5bd7d (diff) | |
download | iciql-1fcbeeb471ecde1b487bece52644ddc6713592ac.tar.gz iciql-1fcbeeb471ecde1b487bece52644ddc6713592ac.zip |
Refactoring.
-rw-r--r-- | src/com/iciql/Query.java | 15 |
1 files 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<T> { * @return the joined query
*/
- @SuppressWarnings({ "unchecked", "rawtypes" })
public <A> QueryJoin<T> innerJoin(A alias) {
- TableDefinition<T> def = (TableDefinition<T>) db.define(alias.getClass());
- SelectTable<T> 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 <A> QueryJoin<T> leftJoin(A alias) {
+ return join(alias, true);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private <A> QueryJoin<T> join(A alias, boolean outerJoin) {
TableDefinition<T> def = (TableDefinition<T>) db.define(alias.getClass());
- SelectTable<T> join = new SelectTable(db, this, alias, true);
+ SelectTable<T> join = new SelectTable(db, this, alias, outerJoin);
def.initSelectObject(join, alias, aliasMap);
joins.add(join);
return new QueryJoin(this, join);
|