Job Atom
The following features are supported:
5152535455565758596061
}); } @Test public void delete_with() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "M1-A1"), "motorman"); dao.deleteWith(t, "motorman"); assertEquals(4, dao.count(Soldier.class)); assertEquals(1, dao.count(Tank.class));
6364656667686970717273
}); } @Test public void clear_links() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetch(Tank.class, "M1-A1"); dao.clearLinks(t, "motorman"); assertEquals(4, dao.count(Soldier.class)); assertEquals(2, dao.count(Tank.class));
7576777879808182838485
}); } @Test public void update_links() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "M1-A1"), "motorman"); t.getMotorman().setAge(32); dao.updateLinks(t, "motorman"); Soldier s = dao.fetch(Soldier.class, t.getMotorName());
8889909192939495969798
}); } @Test public void update_with() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "M1-A1"), "motorman"); t.getMotorman().setAge(32); t.setWeight(50); dao.updateWith(t, "motorman");
106107108109110111112113114115116
sql = dao.sqls().create("tank.insert"); sql.vars().set("id", platoonId); sql.params().set("code", "T4").set("weight", 15); dao.execute(sql); TableName.run(platoonId, new Atom() { public void run() { assertEquals(4, dao.count(Tank.class)); } }); }
2829303132333435363738
pojos.dropPlatoon(p.getId()); } @Test public void delete_links() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "T92"), "members"); assertEquals(3, t.getMembers().size()); dao.deleteLinks(t, "members"); assertEquals(2, dao.count(Soldier.class));
4142434445464748495051
}); } @Test public void delete_links_partly() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "T92"), "members"); t.getMembers().remove("Mick"); dao.deleteLinks(t, "members"); assertEquals(2, dao.count(Tank.class));
5556575859606162636465
}); } @Test public void delete_with() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "T92"), "members"); dao.deleteWith(t, "members"); assertEquals(1, dao.count(Tank.class)); assertEquals(2, dao.count(Soldier.class));
6869707172737475767778
}); } @Test public void delete_with_partly() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "T92"), "members"); t.getMembers().remove("Peter"); dao.deleteWith(t, "members"); assertEquals(1, dao.count(Tank.class));
8283848586878889909192
}); } @Test public void clear_links() { TableName.run(platoon, new Atom() { public void run() { Tank t = dao.fetchLinks(dao.fetch(Tank.class, "T92"), "members"); dao.clearLinks(t, "members"); assertEquals(5, dao.count(Soldier.class)); assertEquals(3, dao.count("dao_d_m_soldier_tank_" + platoon.getId()));