public void testCaseWhen() throws Exception { session.tranSync(WriteJobs.dummy("/bleujin", 10)); Rows rows = session .pathBy("/bleujin") .children() .toRows( Page.TEN, "(case when this.name='dummy' then true else false end) as isbleujin"); // rows.debugPrint() ; assertEquals(true, rows.firstRow().getBoolean("isbleujin")); }
public void testOldInterface() throws Exception { session.tranSync(WriteJobs.dummy("/bleujin", 120)); Rows rows = session .pathBy("/bleujin") .children() .ascending("dummy") .toRows(Page.create(10, 11, 10), "this.name b, dummy, this.age"); assertEquals(20, rows.firstRow().getInt("cnt")); assertEquals(100, rows.firstRow().getInt("dummy")); rows = session .pathBy("/bleujin") .children() .ascending("dummy") .toRows(Page.create(10, 5, 10), "this.name b, dummy, this.age"); assertEquals(101, rows.firstRow().getInt("cnt")); assertEquals(40, rows.firstRow().getInt("dummy")); }