package cn.ls.tree;
import java.util.HashSet;
import java.util.Set;
/**
* 部门
*
* @author tyg
*
*/
public class Department {
private Long id;
private Department parent; //用于自连接.
private Set<Department> children = new HashSet<Department>();
private String name;
private String description;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Department getParent() {
return parent;
}
public void setParent(Department parent) {
this.parent = parent;
}
public Set<Department> getChildren() {
return children;
}
public void setChildren(Set<Department> children) {
this.children = children;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = descrip
【Java核心技术】用于自连接的递归调用示例
最新推荐文章于 2022-02-20 17:28:13 发布