Examples of Atom


Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_links_partly() {
    TableName.run(platoon, new Atom() {
      public void run() {
        TableName.run(platoon, new Atom() {
          public void run() {
            Soldier s = dao.fetchLinks(dao.fetch(Soldier.class, "ZZH"), "guns");
            s.getGuns()[1] = null;
            dao.deleteLinks(s, "guns");
            assertEquals(9, dao.count(Gun.class));
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_null_field_links_partly() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Platoon p = dao.fetchLinks(dao.fetch(Platoon.class), "tanks|soliders");
        p.getTanks().remove("M1-A1");
        p.getSoliders().remove(0);
        dao.deleteLinks(p, "tanks|soliders");
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_with() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Soldier s = dao.fetchLinks(dao.fetch(Soldier.class, "ZZH"), "guns");
        dao.deleteWith(s, "guns");
        assertEquals(4, dao.count(Soldier.class));
        assertEquals(8, dao.count(Gun.class));
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_with_partly() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Soldier s = dao.fetchLinks(dao.fetch(Soldier.class, "ZZH"), "guns");
        s.getGuns()[1] = null;
        dao.deleteWith(s, "guns");
        assertEquals(4, dao.count(Soldier.class));
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void clear_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Soldier s = dao.fetch(Soldier.class, "ZZH");
        dao.clearLinks(s, "guns");
        assertEquals(5, dao.count(Soldier.class));
        assertEquals(8, dao.count(Gun.class));
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void clear_null_field_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Platoon p = dao.fetch(Platoon.class);
        dao.clearLinks(p, "tanks|soliders");
        assertEquals(1, dao.count(Platoon.class));
        /*
 
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void update_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Soldier s = dao.fetchLinks(dao.fetch(Soldier.class, "ZZH"), "guns");
        s.setAge(25);
        s.getGuns()[0].setType(Gun.TYPE.AK47);
        s.getGuns()[1].setType(Gun.TYPE.AK47);
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void update_with() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Soldier s = dao.fetchLinks(dao.fetch(Soldier.class, "ZZH"), "guns");
        s.setAge(25);
        s.getGuns()[0].setType(Gun.TYPE.AK47);
        s.getGuns()[1].setType(Gun.TYPE.AK47);
View Full Code Here

Examples of org.nutz.trans.Atom

    pojos.dropPlatoon(p.getId());
  }

  @Test
  public void fetch_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Platoon p = dao.fetchLinks(dao.fetch(Platoon.class), "leader");
        assertEquals("ZZH", p.getLeaderName());
        assertEquals("ZZH", p.getLeader().getName());
      }
View Full Code Here

Examples of org.nutz.trans.Atom

    });
  }

  @Test
  public void delete_links() {
    TableName.run(platoon, new Atom() {
      public void run() {
        Tank t = dao.fetchLinks(dao.fetch(Tank.class, "M1-A1"), "motorman");
        dao.deleteLinks(t, "motorman");
        assertEquals(4, dao.count(Soldier.class));
        assertEquals(2, dao.count(Tank.class));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.