Package org.nutz.trans

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


    });
  }

  @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

    });
  }

  @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

    });
  }

  @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

    });
  }

  @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

    });
  }

  @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

    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

    });
  }

  @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

    });
  }

  @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));
View Full Code Here

    });
  }

  @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));
View Full Code Here

TOP

Related Classes of org.nutz.trans.Atom

Copyright © 2018 www.massapicom. 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.