976aa9602a18298476427a47c2e828628845c520.svn-base
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.test.entity;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.thinkgem.jeesite.common.persistence.TreeEntity;
/**
* 树结构生成Entity
* @author ThinkGem
* @version 2015-04-06
*/
public class TestTree extends TreeEntity<TestTree> {
private static final long serialVersionUID = 1L;
private TestTree parent; // 父级编号
private String parentIds; // 所有父级编号
private String name; // 名称
private Integer sort; // 排序
public TestTree() {
super();
}
public TestTree(String id){
super(id);
}
@JsonBackReference
@NotNull(message="父级编号不能为空")
public TestTree getParent() {
return parent;
}
public void setParent(TestTree parent) {
this.parent = parent;
}
@Length(min=1, max=2000, message="所有父级编号长度必须介于 1 和 2000 之间")
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Length(min=1, max=100, message="名称长度必须介于 1 和 100 之间")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@NotNull(message="排序不能为空")
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getParentId() {
return parent != null && parent.getId() != null ? parent.getId() : "0";
}
}