use of com.github.drinkjava2.jsqlbox.handler.EntityNetHandler in project jSqlBox by drinkjava2.
the class HandlersTest method testEntityNetHandler.
@Test
public void testEntityNetHandler() {
EntityNet net = ctx.nQuery(new EntityNetHandler(DemoUser.class), "select u.** from DemoUser u where u.age>?", 0);
List<DemoUser> result = net.getAllEntityList(DemoUser.class);
Assert.assertTrue(result.size() == 99);
}
use of com.github.drinkjava2.jsqlbox.handler.EntityNetHandler in project jSqlBox by drinkjava2.
the class EntityNetDemoTest method testEntityNetQuery.
@Test
public void testEntityNetQuery() {
insertDemoData();
EntityNet net = ctx.nQuery(new EntityNetHandler(User.class, Email.class), "select u.**, e.** from usertb u, emailtb e where u.id=e.userId");
Assert.assertEquals(8, net.size());
Set<Email> emails = net.findEntitySet(Email.class, new Path(User.class).where("id='u1' or id='u2'").autoPath(Email.class));
Assert.assertEquals(4, emails.size());
}
Aggregations