package com.example.survey.entity; import lombok.*; import org.bson.types.ObjectId; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.DBRef; import org.springframework.data.mongodb.core.mapping.Document; import java.util.List; /** * @author Pope */ @Data @Document(collection = "department") public class Department { /** * id */ private ObjectId id; /** * 部门名 */ private String name; /** * 子部门 */ @DBRef private List children; /** * 父部门 */ private String parent; }