use of com.github.drinkjava2.functionstest.entitynet.entities.Role in project jSqlBox by drinkjava2.
the class EntityNetDemoTest method testAutoPath.
@Test
public void testAutoPath() {
insertDemoData();
EntityNet net = ctx.netLoad(new User(), new Role(), Privilege.class, UserRole.class, RolePrivilege.class);
Set<Privilege> privileges = net.findEntitySet(Privilege.class, new Path(User.class).where("id='u1' or id='u2'").autoPath(Privilege.class));
for (Privilege privilege : privileges) System.out.print(privilege.getId() + " ");
Assert.assertEquals(3, privileges.size());
}
use of com.github.drinkjava2.functionstest.entitynet.entities.Role in project jSqlBox by drinkjava2.
the class EntityNetDemoTest method testAutoPathAndBind.
@Test
public void testAutoPathAndBind() {
insertDemoData();
EntityNet net = ctx.netLoad(new User(), new Role(), Privilege.class, UserRole.class, RolePrivilege.class);
Set<Privilege> privileges = net.findEntitySet(Privilege.class, new Path(User.class).where("id='u1' or id='u2'").autoPath(Privilege.class));
for (Privilege privilege : privileges) System.out.print(privilege.getId() + " ");
Assert.assertEquals(3, privileges.size());
}
use of com.github.drinkjava2.functionstest.entitynet.entities.Role in project jSqlBox by drinkjava2.
the class EntityNetDemoTest method testloadEntityNet.
@Test
public void testloadEntityNet() {
insertDemoData();
EntityNet net = ctx.netLoad(new User(), Email.class, Address.class, new Role(), Privilege.class, UserRole.class, RolePrivilege.class);
Assert.assertEquals(37, net.size());
System.out.println(net.size());
List<User> users = net.getAllEntityList(User.class);
Assert.assertEquals(5, users.size());
Assert.assertEquals("user1", users.get(0).getUserName());
System.out.println(users.get(0).getUserName());
}
Aggregations