diff options
author | James Moger <james.moger@gmail.com> | 2011-12-05 17:01:37 -0500 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-12-05 17:01:37 -0500 |
commit | 53bdab2caad16bec8425dc173780b39bbccfc375 (patch) | |
tree | 4ad7f9eceefce08d95afcabeabfd3d7b322467b2 /src/com/iciql/QueryJoin.java | |
parent | 4ebfeaac5790760c01fa1af11525b4964445bf93 (diff) | |
download | iciql-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.java | 37 |
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);
}
|