summaryrefslogtreecommitdiffstats
path: root/src/com/iciql/QueryJoin.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2011-12-05 17:01:37 -0500
committerJames Moger <james.moger@gmail.com>2011-12-05 17:01:37 -0500
commit53bdab2caad16bec8425dc173780b39bbccfc375 (patch)
tree4ad7f9eceefce08d95afcabeabfd3d7b322467b2 /src/com/iciql/QueryJoin.java
parent4ebfeaac5790760c01fa1af11525b4964445bf93 (diff)
downloadiciql-53bdab2caad16bec8425dc173780b39bbccfc375.tar.gz
iciql-53bdab2caad16bec8425dc173780b39bbccfc375.zip
Fixed joins on primitives
Diffstat (limited to 'src/com/iciql/QueryJoin.java')
-rw-r--r--src/com/iciql/QueryJoin.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/com/iciql/QueryJoin.java b/src/com/iciql/QueryJoin.java
index bb614eb..dbb3d15 100644
--- a/src/com/iciql/QueryJoin.java
+++ b/src/com/iciql/QueryJoin.java
@@ -31,6 +31,43 @@ public class QueryJoin {
this.join = join;
}
+ public QueryJoinCondition<Boolean> on(boolean x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Byte> on(byte x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Short> on(short x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Integer> on(int x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Long> on(long x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Float> on(float x) {
+ return addPrimitive(x);
+ }
+
+ public QueryJoinCondition<Double> on(double x) {
+ return addPrimitive(x);
+ }
+
+ private <A> QueryJoinCondition<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<A>(query, join, alias);
+ }
+
public <A> QueryJoinCondition<A> on(A x) {
return new QueryJoinCondition<A>(query, join, x);
}