summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2011-12-06 07:57:51 -0500
committerJames Moger <james.moger@gmail.com>2011-12-06 07:57:51 -0500
commitad70685918aac114a4babd9a1a0e0217b6323df0 (patch)
treed7e528a0b8fb02382466965ca7e443060c1c70fd /tests
parent53bdab2caad16bec8425dc173780b39bbccfc375 (diff)
downloadiciql-ad70685918aac114a4babd9a1a0e0217b6323df0.tar.gz
iciql-ad70685918aac114a4babd9a1a0e0217b6323df0.zip
Fixed bug in primitive group by clauses
Diffstat (limited to 'tests')
-rw-r--r--tests/com/iciql/test/JoinTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/com/iciql/test/JoinTest.java b/tests/com/iciql/test/JoinTest.java
index eab1376..018d721 100644
--- a/tests/com/iciql/test/JoinTest.java
+++ b/tests/com/iciql/test/JoinTest.java
@@ -28,6 +28,7 @@ import org.junit.Test;
import com.iciql.Db;
import com.iciql.Iciql.IQColumn;
import com.iciql.Iciql.IQTable;
+import com.iciql.util.IciqlLogger;
/**
* Tests of Joins.
@@ -68,6 +69,23 @@ public class JoinTest {
assertEquals(3, notes.size());
}
+
+ @Test
+ public void testJoin() throws Exception {
+ db.insertAll(UserId.getList());
+ db.insertAll(UserNote.getList());
+
+ final UserId u = new UserId();
+ final UserNote n = new UserNote();
+
+ // this query returns 1 UserId if the user has a note
+ List<UserId> users = (List<UserId>) db.from(u).innerJoin(n).on(u.id).is(n.userId).groupBy(u.id).where(u.id).is(2).select();
+
+ db.dropTable(UserId.class);
+ db.dropTable(UserNote.class);
+
+ assertEquals(1, users.size());
+ }
@IQTable
public static class UserId {