Package com.google.code.lightssh.project.tree.entity

Examples of com.google.code.lightssh.project.tree.entity.Tree


    if( t.isInsert() ){
      Node root = new Node("root","tree root node!");
      t.setRoot(root);
      dao.create(t);
    }else{
      Tree db_tree = dao.read(t);
      if( db_tree != null){
        db_tree.setName(t.getName());
        db_tree.setDescription(t.getDescription());
        db_tree.setMaxChildren(t.getMaxChildren());
        db_tree.setMaxLayer(t.getMaxLayer());
        dao.update(db_tree);   
      }
    }
  }
View Full Code Here


  @Override
  public void saveNode(Tree tree,Node node) {
    if( node == null || tree == null )
      throw new ApplicationException("树和结点都不能为空!");
   
    Tree db_tree = this.get(tree);
    if( db_tree == null )
      throw new ApplicationException("树已不存在!");
   
    if(node.getParent()==null ||
        StringUtil.clean(node.getParent().getIdentity())==null ){
      node.setParent( db_tree.getRoot() );
    }else{
      Node parent = nodeDao.read(node.getParent());
      if( parent == null )
        throw new ApplicationException("父结点(id="
            +node.getParent().getIdentity()+")已不存在!");
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.project.tree.entity.Tree

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.