コード例 #1
0
  public void testLoadM() throws Exception {
    Database database = _category.getDatabase();

    database.begin();
    M m = (M) database.load(M.class, new Integer(1));
    database.commit();

    assertNotNull(m);
    assertEquals(1, m.getId());
    assertEquals("m1", m.getName());

    Collection ns = m.getNs();
    assertNotNull(ns);
    assertEquals(2, ns.size());

    database.close();
  }
コード例 #2
0
  private ZTree convertToZtree(M m, boolean open, boolean onlyCheckLeaf) {
    ZTree<ID> zTree = new ZTree<ID>();
    zTree.setId(m.getId());
    zTree.setpId(m.getParentId());
    zTree.setName(m.getName());
    zTree.setIconSkin(m.getIcon());
    zTree.setOpen(open);
    zTree.setRoot(m.isRoot());
    zTree.setIsParent(m.isHasChildren());

    if (onlyCheckLeaf && zTree.isIsParent()) {
      zTree.setNocheck(true);
    } else {
      zTree.setNocheck(false);
    }

    return zTree;
  }
コード例 #3
0
 private boolean isNameUnique() {
   return overallModel.isNameUnique(pageModel.getName().getText());
 }
コード例 #4
0
 private boolean isNameDefined() {
   return !pageModel.getName().isEmpty();
 }