Examples of Base


Examples of org.nutz.dao.test.meta.Base

  }

  @Test
  public void delete_links() {
    assertEquals(6, dao.count(Platoon.class));
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    dao.deleteLinks(b, "platoons");
    assertEquals(3, dao.count(Platoon.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(3, dao.count(Platoon.class));
  }

  @Test
  public void delete_null_field_links() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "wavebands");
    dao.deleteLinks(b, "wavebands");
    assertEquals(0, dao.count(WaveBand.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(0, dao.count(WaveBand.class));
  }

  @Test
  public void delete_links_partly() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    b.getPlatoons().remove("C");
    dao.deleteLinks(b, "platoons");
    assertEquals(4, dao.count(Platoon.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(4, dao.count(Platoon.class));
  }

  @Test
  public void delete_null_field_links_partly() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "wavebands");
    b.getWavebands().remove(0);
    dao.deleteLinks(b, "wavebands");
    assertEquals(1, dao.count(WaveBand.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(1, dao.count(WaveBand.class));
  }

  @Test
  public void delete_with() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    dao.deleteWith(b, "platoons");
    assertEquals(3, dao.count(Platoon.class));
    assertEquals(1, dao.count(Base.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(1, dao.count(Base.class));
  }

  @Test
  public void delete_with_partly() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    b.getPlatoons().remove("C");
    dao.deleteWith(b, "platoons");
    assertEquals(4, dao.count(Platoon.class));
    assertEquals(1, dao.count(Base.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(1, dao.count(Base.class));
  }

  @Test
  public void clear_links() {
    Base b = dao.fetch(Base.class, "red");
    dao.clearLinks(b, "platoons");
    assertEquals(3, dao.count(Platoon.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(3, dao.count(Platoon.class));
  }

  @Test
  public void clear_null_field_links() {
    Base b = dao.fetch(Base.class, "red");
    dao.clearLinks(b, "wavebands");
    assertEquals(0, dao.count(WaveBand.class));
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(0, dao.count(WaveBand.class));
  }

  @Test
  public void update_links() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "blue"), "platoons");
    int lv = b.getLevel();
    b.setLevel(45);
    for (Iterator<Platoon> it = b.getPlatoons().values().iterator(); it.hasNext();) {
      it.next().setBaseName("red");
    }
    dao.updateLinks(b, "platoons");
    b = dao.fetch(Base.class, "blue");
    assertEquals(lv, b.getLevel());
    b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    assertEquals(6, b.getPlatoons().size());
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Base

    assertEquals(6, b.getPlatoons().size());
  }

  @Test
  public void update_with() {
    Base b = dao.fetchLinks(dao.fetch(Base.class, "blue"), "platoons");
    b.setLevel(45);
    for (Iterator<Platoon> it = b.getPlatoons().values().iterator(); it.hasNext();) {
      it.next().setBaseName("red");
    }
    dao.updateWith(b, "platoons");
    b = dao.fetch(Base.class, "blue");
    assertEquals(45, b.getLevel());
    b = dao.fetchLinks(dao.fetch(Base.class, "red"), "platoons");
    assertEquals(6, b.getPlatoons().size());
  }
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.