* @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