凡是属性中有Set的都直接声明中直接new出来,避免后面出现空指针异常,比如:
public class Department {
private Long id;
private String name;
private String description;
private Department parent;
private Set<Department> children = new HashSet<Department>();
private Set<User> users = new HashSet<User>();