liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.sys.entity;
 
import org.hibernate.validator.constraints.Length;
 
import com.jeeplus.common.persistence.TreeEntity;
 
/**
 * 区域Entity
 * @author jeeplus
 * @version 2013-05-15
 */
public class Area extends TreeEntity<Area> {
 
    private static final long serialVersionUID = 1L;
//    private Area parent;    // 父级编号
//    private String parentIds; // 所有父级编号
    private String code;     // 区域编码
//    private String name;     // 区域名称
//    private Integer sort;        // 排序
    private String type;     // 区域类型(1:国家;2:省份、直辖市;3:地市;4:区县)
    
    public Area(){
        super();
        this.sort = 30;
    }
 
    public Area(String id){
        super(id);
    }
    
//    @JsonBackReference
//    @NotNull
    public Area getParent() {
        return parent;
    }
 
    public void setParent(Area parent) {
        this.parent = parent;
    }
//
//    @Length(min=1, max=2000)
//    public String getParentIds() {
//        return parentIds;
//    }
//
//    public void setParentIds(String parentIds) {
//        this.parentIds = parentIds;
//    }
//    
//    @Length(min=1, max=100)
//    public String getName() {
//        return name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public Integer getSort() {
//        return sort;
//    }
//
//    public void setSort(Integer sort) {
//        this.sort = sort;
//    }
 
    @Length(min=1, max=1)
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    @Length(min=0, max=100)
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
//
//    public String getParentId() {
//        return parent != null && parent.getId() != null ? parent.getId() : "0";
//    }
    
    @Override
    public String toString() {
        return name;
    }
}