diff options
author | James Moger <james.moger@gmail.com> | 2011-12-06 07:57:51 -0500 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-12-06 07:57:51 -0500 |
commit | ad70685918aac114a4babd9a1a0e0217b6323df0 (patch) | |
tree | d7e528a0b8fb02382466965ca7e443060c1c70fd /tests | |
parent | 53bdab2caad16bec8425dc173780b39bbccfc375 (diff) | |
download | iciql-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.java | 18 |
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 { |