aboutsummaryrefslogtreecommitdiffstats
path: root/tests/com
diff options
context:
space:
mode:
authorTaichi Uragami <backpaper0@gmail.com>2012-04-06 23:52:39 +0900
committerTaichi Uragami <backpaper0@gmail.com>2012-04-06 23:52:39 +0900
commitcb29e503658e2a3339c265651a869fcbe0d5bd7d (patch)
treedadc0427de27e270b83398bfd31282e1991efdaf /tests/com
parent25e92e1b20d58b523c8a1e2090241552bc4489cd (diff)
downloadiciql-cb29e503658e2a3339c265651a869fcbe0d5bd7d.tar.gz
iciql-cb29e503658e2a3339c265651a869fcbe0d5bd7d.zip
Added support for left outer join.
Diffstat (limited to 'tests/com')
-rw-r--r--tests/com/iciql/test/JoinTest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/com/iciql/test/JoinTest.java b/tests/com/iciql/test/JoinTest.java
index 07de098..1fea444 100644
--- a/tests/com/iciql/test/JoinTest.java
+++ b/tests/com/iciql/test/JoinTest.java
@@ -81,6 +81,16 @@ public class JoinTest {
assertEquals(2, users.get(0).id);
}
+ @Test
+ public void testLeftJoin() throws Exception {
+ final UserId u = new UserId();
+ final UserNote n = new UserNote();
+
+ List<UserId> notes = db.from(u).leftJoin(n).on(u.id).is(n.userId).where(u.id).is(4).select();
+ assertEquals(1, notes.size());
+ assertEquals(4, notes.get(0).id);
+ }
+
@IQTable
public static class UserId {
@@ -104,7 +114,7 @@ public class JoinTest {
}
public static List<UserId> getList() {
- UserId[] list = { new UserId(1, "Tom"), new UserId(2, "Dick"), new UserId(3, "Harry") };
+ UserId[] list = { new UserId(1, "Tom"), new UserId(2, "Dick"), new UserId(3, "Harry"), new UserId(4, "Jack") };
return Arrays.asList(list);
}
}