use of com.github.drinkjava2.functionstest.entitynet.entities.TreeNode in project jSqlBox by drinkjava2.
the class EntityNetTreeTest method testSearchTreeChild.
@Test
public void testSearchTreeChild() {
EntityNet net = ctx.netLoad(TreeNode.class);
Set<TreeNode> TreeNodes = net.findEntitySet(TreeNode.class, new Path("S+", TreeNode.class).where("id=? or id=?", "B", "D").nextPath("C*", TreeNode.class, "pid"));
for (TreeNode node : TreeNodes) System.out.print(node.getId() + " ");
Assert.assertEquals(9, TreeNodes.size());
}
use of com.github.drinkjava2.functionstest.entitynet.entities.TreeNode in project jSqlBox by drinkjava2.
the class EntityNetTreeTest method testSearchTreeParent.
@Test
public void testSearchTreeParent() {
EntityNet net = ctx.netLoad(TreeNode.class);
Set<TreeNode> TreeNodes = net.findEntitySet(TreeNode.class, new Path("S-", TreeNode.class).where("id='F' or id='K'").nextPath("P*", TreeNode.class, "pid"));
for (TreeNode node : TreeNodes) System.out.print(node.getId() + " ");
Assert.assertEquals(4, TreeNodes.size());
}
use of com.github.drinkjava2.functionstest.entitynet.entities.TreeNode in project jSqlBox by drinkjava2.
the class EntityNetTreeTest method init.
@Before
public void init() {
super.init();
// ctx.setAllowShowSQL(true);
TableModel[] models = TableModelUtils.entity2Models(TreeNode.class);
dropAndCreateDatabase(models);
new TreeNode().putFields("id", "comments", "pid");
new TreeNode().putValues("A", "found a bug", null).insert();
new TreeNode().putValues("B", "is a worm?", "A").insert();
new TreeNode().putValues("E", "no", "B").insert();
new TreeNode().putValues("F", "is a bug", "B").insert();
new TreeNode().putValues("C", "oh, a bug", "A").insert();
new TreeNode().putValues("G", "need solve it", "C").insert();
new TreeNode().putValues("D", "careful it bites", "A").insert();
new TreeNode().putValues("H", "it does not bite", "D").insert();
new TreeNode().putValues("J", "found the reason", "H").insert();
new TreeNode().putValues("K", "solved", "H").insert();
new TreeNode().putValues("L", "uploaded", "H").insert();
new TreeNode().putValues("I", "well done!", "D").insert();
System.out.println();
}
use of com.github.drinkjava2.functionstest.entitynet.entities.TreeNode in project jSqlBox by drinkjava2.
the class EntityNetTreeTest method testSearchTreeChild2.
@Test
public void testSearchTreeChild2() {
EntityNet net = ctx.netLoad(TreeNode.class);
Set<TreeNode> TreeNodes = net.findEntitySet(TreeNode.class, new Path("C*", TreeNode.class, "pid"), new TreeNode("B"), new TreeNode("D"));
for (TreeNode node : TreeNodes) System.out.print(node.getId() + " ");
Assert.assertEquals(7, TreeNodes.size());
}
Aggregations