diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/iciql/Query.java | 2 | ||||
-rw-r--r-- | src/com/iciql/QueryJoin.java | 32 | ||||
-rw-r--r-- | src/com/iciql/QueryJoinCondition.java | 26 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/com/iciql/Query.java b/src/com/iciql/Query.java index 2f5141d..b43f774 100644 --- a/src/com/iciql/Query.java +++ b/src/com/iciql/Query.java @@ -725,7 +725,7 @@ public class Query<T> { */
@SuppressWarnings({ "unchecked", "rawtypes" })
- public <U> QueryJoin innerJoin(U alias) {
+ 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);
diff --git a/src/com/iciql/QueryJoin.java b/src/com/iciql/QueryJoin.java index dbb3d15..652d937 100644 --- a/src/com/iciql/QueryJoin.java +++ b/src/com/iciql/QueryJoin.java @@ -21,54 +21,54 @@ package com.iciql; * This class represents a query with a join.
*/
-public class QueryJoin {
+public class QueryJoin<T> {
- private Query<?> query;
- private SelectTable<?> join;
+ private Query<T> query;
+ private SelectTable<T> join;
- QueryJoin(Query<?> query, SelectTable<?> join) {
+ QueryJoin(Query<T> query, SelectTable<T> join) {
this.query = query;
this.join = join;
}
- public QueryJoinCondition<Boolean> on(boolean x) {
+ public QueryJoinCondition<T, Boolean> on(boolean x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Byte> on(byte x) {
+ public QueryJoinCondition<T, Byte> on(byte x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Short> on(short x) {
+ public QueryJoinCondition<T, Short> on(short x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Integer> on(int x) {
+ public QueryJoinCondition<T, Integer> on(int x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Long> on(long x) {
+ public QueryJoinCondition<T, Long> on(long x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Float> on(float x) {
+ public QueryJoinCondition<T, Float> on(float x) {
return addPrimitive(x);
}
- public QueryJoinCondition<Double> on(double x) {
+ public QueryJoinCondition<T, Double> on(double x) {
return addPrimitive(x);
}
- private <A> QueryJoinCondition<A> addPrimitive(A x) {
+ private <A> QueryJoinCondition<T, A> addPrimitive(A x) {
A alias = query.getPrimitiveAliasByValue(x);
if (alias == null) {
// this will result in an unmapped field exception
- return new QueryJoinCondition<A>(query, join, x);
+ return new QueryJoinCondition<T, A>(query, join, x);
}
- return new QueryJoinCondition<A>(query, join, alias);
+ return new QueryJoinCondition<T, A>(query, join, alias);
}
- public <A> QueryJoinCondition<A> on(A x) {
- return new QueryJoinCondition<A>(query, join, x);
+ public <A> QueryJoinCondition<T, A> on(A x) {
+ return new QueryJoinCondition<T, A>(query, join, x);
}
}
diff --git a/src/com/iciql/QueryJoinCondition.java b/src/com/iciql/QueryJoinCondition.java index b49e35b..6dfd218 100644 --- a/src/com/iciql/QueryJoinCondition.java +++ b/src/com/iciql/QueryJoinCondition.java @@ -25,48 +25,48 @@ package com.iciql; * the incomplete condition data type
*/
-public class QueryJoinCondition<A> {
+public class QueryJoinCondition<T, A> {
- private Query<?> query;
- private SelectTable<?> join;
+ private Query<T> query;
+ private SelectTable<T> join;
private A x;
- QueryJoinCondition(Query<?> query, SelectTable<?> join, A x) {
+ QueryJoinCondition(Query<T> query, SelectTable<T> join, A x) {
this.query = query;
this.join = join;
this.x = x;
}
- public Query<?> is(boolean y) {
+ public Query<T> is(boolean y) {
return addPrimitive(y);
}
- public Query<?> is(byte y) {
+ public Query<T> is(byte y) {
return addPrimitive(y);
}
- public Query<?> is(short y) {
+ public Query<T> is(short y) {
return addPrimitive(y);
}
- public Query<?> is(int y) {
+ public Query<T> is(int y) {
return addPrimitive(y);
}
- public Query<?> is(long y) {
+ public Query<T> is(long y) {
return addPrimitive(y);
}
- public Query<?> is(float y) {
+ public Query<T> is(float y) {
return addPrimitive(y);
}
- public Query<?> is(double y) {
+ public Query<T> is(double y) {
return addPrimitive(y);
}
@SuppressWarnings("unchecked")
- private Query<?> addPrimitive(Object o) {
+ private Query<T> addPrimitive(Object o) {
A alias = query.getPrimitiveAliasByValue((A) o);
if (alias == null) {
join.addConditionToken(new Condition<A>(x, (A) o, CompareType.EQUAL));
@@ -76,7 +76,7 @@ public class QueryJoinCondition<A> { return query;
}
- public Query<?> is(A y) {
+ public Query<T> is(A y) {
join.addConditionToken(new Condition<A>(x, y, CompareType.EQUAL));
return query;
}
|