1
2
3
4
5 package gboat2.web.model;
6
7 import java.util.LinkedList;
8 import java.util.List;
9
10 import javax.persistence.Column;
11 import javax.persistence.Entity;
12 import javax.persistence.GeneratedValue;
13 import javax.persistence.Id;
14 import javax.persistence.Table;
15 import javax.persistence.Transient;
16
17 import org.hibernate.annotations.GenericGenerator;
18
19
20
21
22
23 @Entity
24 @Table(name = "G2_T_RESOURCE")
25 public class Resource {
26
27 private String resId;
28
29
30 private String resName;
31
32
33 private String moduleName;
34
35
36 private String resCode;
37
38
39 private String resUrl;
40
41
42 private Boolean mainMenu;
43
44
45 private String parentId = "0";
46
47
48 private double dispOrder = 1F;
49
50
51 private String singleton = "0";
52
53
54 private String bundle;
55
56
57 private String actionClass;
58
59
60 private String status;
61
62
63 private String type = "0";
64
65
66 private String systemId;
67
68
69 private List<Resource> children;
70
71
72 private boolean leaf = true;
73
74
75 private boolean disabled = false;
76
77 @Transient
78 public boolean getLeaf() {
79 return leaf;
80 }
81
82 public void setLeaf(boolean leaf) {
83 this.leaf = leaf;
84 }
85
86 @Id
87 @GenericGenerator(name = "generator", strategy = "uuid.hex")
88 @GeneratedValue(generator = "generator")
89 @Column(name = "RES_ID", length = 40)
90 public String getResId() {
91 return resId;
92 }
93
94 public void setResId(String resId) {
95 this.resId = resId;
96 }
97
98 @Column(name = "RES_NAME", length = 200)
99 public String getResName() {
100 return resName;
101 }
102
103 public void setResName(String resName) {
104 this.resName = resName;
105 }
106
107 @Column(name = "MODULE_NAME", length = 200)
108 public String getModuleName() {
109 return moduleName;
110 }
111
112 public void setModuleName(String moduleName) {
113 this.moduleName = moduleName;
114 }
115
116 @Column(name = "RES_CODE", length = 50)
117 public String getResCode() {
118 return resCode;
119 }
120
121 public void setResCode(String resCode) {
122 this.resCode = resCode;
123 }
124
125 @Column(name = "RES_URL", length = 400)
126 public String getResUrl() {
127 return resUrl;
128 }
129
130 public void setResUrl(String resUrl) {
131 this.resUrl = resUrl;
132 }
133
134 @Column(name = "PARENT_ID", length = 40)
135 public String getParentId() {
136 return parentId;
137 }
138
139 public void setParentId(String parentId) {
140 this.parentId = parentId;
141 }
142
143 @Column(name = "DISP_ORDER")
144 public double getDispOrder() {
145 return dispOrder;
146 }
147
148 public void setDispOrder(double dispOrder) {
149 this.dispOrder = dispOrder;
150 }
151
152 @Column(name = "SINGLETON", length = 1)
153 public String getSingleton() {
154 return singleton;
155 }
156
157 public void setSingleton(String singleton) {
158 this.singleton = singleton;
159 }
160
161 @Column(name = "BUNDLE", length = 100)
162 public String getBundle() {
163 return bundle;
164 }
165
166 public void setBundle(String bundle) {
167 this.bundle = bundle;
168 }
169
170 @Column(name = "ACTION_CLASS", length = 200)
171 public String getActionClass() {
172 return actionClass;
173 }
174
175 public void setActionClass(String actionClass) {
176 this.actionClass = actionClass;
177 }
178
179 @Column(name = "STATUS", length = 1)
180 public String getStatus() {
181 return status;
182 }
183
184 public void setStatus(String status) {
185 this.status = status;
186 }
187
188 @Transient
189 public List<Resource> getChildren() {
190 return children;
191 }
192
193 public void setChildren(List<Resource> children) {
194 this.children = children;
195 }
196
197 public void addChild(Resource child) {
198 if (this.children == null) {
199 children = new LinkedList<Resource>();
200 }
201 children.add(child);
202 }
203
204 @Column(name = "TYPE", length = 1)
205 public String getType() {
206 return type;
207 }
208
209 public void setType(String type) {
210 this.type = type;
211 }
212
213 @Column(name = "SYSTEM_ID", length = 40)
214 public String getSystemId() {
215 return systemId;
216 }
217
218 public void setSystemId(String systemId) {
219 this.systemId = systemId;
220 }
221
222 @Transient
223 public boolean getDisabled() {
224 return disabled;
225 }
226
227 public void setDisabled(boolean disabled) {
228 this.disabled = disabled;
229 }
230
231 @Column(name = "MAIN_MENU", length = 10)
232 public Boolean getMainMenu() {
233 return mainMenu;
234 }
235
236 public void setMainMenu(Boolean mainMenu) {
237 this.mainMenu = mainMenu;
238 }
239
240
241
242 }