1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.util.GetterUtil;
26 import com.liferay.portal.model.impl.BaseModelImpl;
27 import com.liferay.portal.util.PropsUtil;
28
29 import com.liferay.util.XSSUtil;
30
31 import java.io.Serializable;
32
33 import java.sql.Types;
34
35
54 public class GroupModelImpl extends BaseModelImpl {
55 public static String TABLE_NAME = "Group_";
56 public static Object[][] TABLE_COLUMNS = {
57 { "groupId", new Integer(Types.BIGINT) },
58 { "companyId", new Integer(Types.BIGINT) },
59 { "creatorUserId", new Integer(Types.BIGINT) },
60 { "classNameId", new Integer(Types.BIGINT) },
61 { "classPK", new Integer(Types.BIGINT) },
62 { "parentGroupId", new Integer(Types.BIGINT) },
63 { "liveGroupId", new Integer(Types.BIGINT) },
64 { "name", new Integer(Types.VARCHAR) },
65 { "description", new Integer(Types.VARCHAR) },
66 { "type_", new Integer(Types.VARCHAR) },
67 { "typeSettings", new Integer(Types.VARCHAR) },
68 { "friendlyURL", new Integer(Types.VARCHAR) },
69 { "active_", new Integer(Types.BOOLEAN) }
70 };
71 public static String TABLE_SQL_CREATE = "create table Group_ (groupId LONG not null primary key,companyId LONG,creatorUserId LONG,classNameId LONG,classPK LONG,parentGroupId LONG,liveGroupId LONG,name VARCHAR(75) null,description STRING null,type_ VARCHAR(75) null,typeSettings STRING null,friendlyURL VARCHAR(100) null,active_ BOOLEAN)";
72 public static String TABLE_SQL_DROP = "drop table Group_";
73 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
74 "xss.allow.com.liferay.portal.model.Group"), XSS_ALLOW);
75 public static boolean XSS_ALLOW_NAME = GetterUtil.getBoolean(PropsUtil.get(
76 "xss.allow.com.liferay.portal.model.Group.name"),
77 XSS_ALLOW_BY_MODEL);
78 public static boolean XSS_ALLOW_DESCRIPTION = GetterUtil.getBoolean(PropsUtil.get(
79 "xss.allow.com.liferay.portal.model.Group.description"),
80 XSS_ALLOW_BY_MODEL);
81 public static boolean XSS_ALLOW_TYPE = GetterUtil.getBoolean(PropsUtil.get(
82 "xss.allow.com.liferay.portal.model.Group.type"),
83 XSS_ALLOW_BY_MODEL);
84 public static boolean XSS_ALLOW_TYPESETTINGS = GetterUtil.getBoolean(PropsUtil.get(
85 "xss.allow.com.liferay.portal.model.Group.typeSettings"),
86 XSS_ALLOW_BY_MODEL);
87 public static boolean XSS_ALLOW_FRIENDLYURL = GetterUtil.getBoolean(PropsUtil.get(
88 "xss.allow.com.liferay.portal.model.Group.friendlyURL"),
89 XSS_ALLOW_BY_MODEL);
90 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
91 "lock.expiration.time.com.liferay.portal.model.GroupModel"));
92
93 public GroupModelImpl() {
94 }
95
96 public long getPrimaryKey() {
97 return _groupId;
98 }
99
100 public void setPrimaryKey(long pk) {
101 setGroupId(pk);
102 }
103
104 public Serializable getPrimaryKeyObj() {
105 return new Long(_groupId);
106 }
107
108 public long getGroupId() {
109 return _groupId;
110 }
111
112 public void setGroupId(long groupId) {
113 if (groupId != _groupId) {
114 _groupId = groupId;
115 }
116 }
117
118 public long getCompanyId() {
119 return _companyId;
120 }
121
122 public void setCompanyId(long companyId) {
123 if (companyId != _companyId) {
124 _companyId = companyId;
125 }
126 }
127
128 public long getCreatorUserId() {
129 return _creatorUserId;
130 }
131
132 public void setCreatorUserId(long creatorUserId) {
133 if (creatorUserId != _creatorUserId) {
134 _creatorUserId = creatorUserId;
135 }
136 }
137
138 public long getClassNameId() {
139 return _classNameId;
140 }
141
142 public void setClassNameId(long classNameId) {
143 if (classNameId != _classNameId) {
144 _classNameId = classNameId;
145 }
146 }
147
148 public long getClassPK() {
149 return _classPK;
150 }
151
152 public void setClassPK(long classPK) {
153 if (classPK != _classPK) {
154 _classPK = classPK;
155 }
156 }
157
158 public long getParentGroupId() {
159 return _parentGroupId;
160 }
161
162 public void setParentGroupId(long parentGroupId) {
163 if (parentGroupId != _parentGroupId) {
164 _parentGroupId = parentGroupId;
165 }
166 }
167
168 public long getLiveGroupId() {
169 return _liveGroupId;
170 }
171
172 public void setLiveGroupId(long liveGroupId) {
173 if (liveGroupId != _liveGroupId) {
174 _liveGroupId = liveGroupId;
175 }
176 }
177
178 public String getName() {
179 return GetterUtil.getString(_name);
180 }
181
182 public void setName(String name) {
183 if (((name == null) && (_name != null)) ||
184 ((name != null) && (_name == null)) ||
185 ((name != null) && (_name != null) && !name.equals(_name))) {
186 if (!XSS_ALLOW_NAME) {
187 name = XSSUtil.strip(name);
188 }
189
190 _name = name;
191 }
192 }
193
194 public String getDescription() {
195 return GetterUtil.getString(_description);
196 }
197
198 public void setDescription(String description) {
199 if (((description == null) && (_description != null)) ||
200 ((description != null) && (_description == null)) ||
201 ((description != null) && (_description != null) &&
202 !description.equals(_description))) {
203 if (!XSS_ALLOW_DESCRIPTION) {
204 description = XSSUtil.strip(description);
205 }
206
207 _description = description;
208 }
209 }
210
211 public String getType() {
212 return GetterUtil.getString(_type);
213 }
214
215 public void setType(String type) {
216 if (((type == null) && (_type != null)) ||
217 ((type != null) && (_type == null)) ||
218 ((type != null) && (_type != null) && !type.equals(_type))) {
219 if (!XSS_ALLOW_TYPE) {
220 type = XSSUtil.strip(type);
221 }
222
223 _type = type;
224 }
225 }
226
227 public String getTypeSettings() {
228 return GetterUtil.getString(_typeSettings);
229 }
230
231 public void setTypeSettings(String typeSettings) {
232 if (((typeSettings == null) && (_typeSettings != null)) ||
233 ((typeSettings != null) && (_typeSettings == null)) ||
234 ((typeSettings != null) && (_typeSettings != null) &&
235 !typeSettings.equals(_typeSettings))) {
236 if (!XSS_ALLOW_TYPESETTINGS) {
237 typeSettings = XSSUtil.strip(typeSettings);
238 }
239
240 _typeSettings = typeSettings;
241 }
242 }
243
244 public String getFriendlyURL() {
245 return GetterUtil.getString(_friendlyURL);
246 }
247
248 public void setFriendlyURL(String friendlyURL) {
249 if (((friendlyURL == null) && (_friendlyURL != null)) ||
250 ((friendlyURL != null) && (_friendlyURL == null)) ||
251 ((friendlyURL != null) && (_friendlyURL != null) &&
252 !friendlyURL.equals(_friendlyURL))) {
253 if (!XSS_ALLOW_FRIENDLYURL) {
254 friendlyURL = XSSUtil.strip(friendlyURL);
255 }
256
257 _friendlyURL = friendlyURL;
258 }
259 }
260
261 public boolean getActive() {
262 return _active;
263 }
264
265 public boolean isActive() {
266 return _active;
267 }
268
269 public void setActive(boolean active) {
270 if (active != _active) {
271 _active = active;
272 }
273 }
274
275 public Object clone() {
276 GroupImpl clone = new GroupImpl();
277 clone.setGroupId(getGroupId());
278 clone.setCompanyId(getCompanyId());
279 clone.setCreatorUserId(getCreatorUserId());
280 clone.setClassNameId(getClassNameId());
281 clone.setClassPK(getClassPK());
282 clone.setParentGroupId(getParentGroupId());
283 clone.setLiveGroupId(getLiveGroupId());
284 clone.setName(getName());
285 clone.setDescription(getDescription());
286 clone.setType(getType());
287 clone.setTypeSettings(getTypeSettings());
288 clone.setFriendlyURL(getFriendlyURL());
289 clone.setActive(getActive());
290
291 return clone;
292 }
293
294 public int compareTo(Object obj) {
295 if (obj == null) {
296 return -1;
297 }
298
299 GroupImpl group = (GroupImpl)obj;
300 int value = 0;
301 value = getName().toLowerCase().compareTo(group.getName().toLowerCase());
302
303 if (value != 0) {
304 return value;
305 }
306
307 return 0;
308 }
309
310 public boolean equals(Object obj) {
311 if (obj == null) {
312 return false;
313 }
314
315 GroupImpl group = null;
316
317 try {
318 group = (GroupImpl)obj;
319 }
320 catch (ClassCastException cce) {
321 return false;
322 }
323
324 long pk = group.getPrimaryKey();
325
326 if (getPrimaryKey() == pk) {
327 return true;
328 }
329 else {
330 return false;
331 }
332 }
333
334 public int hashCode() {
335 return (int)getPrimaryKey();
336 }
337
338 private long _groupId;
339 private long _companyId;
340 private long _creatorUserId;
341 private long _classNameId;
342 private long _classPK;
343 private long _parentGroupId;
344 private long _liveGroupId;
345 private String _name;
346 private String _description;
347 private String _type;
348 private String _typeSettings;
349 private String _friendlyURL;
350 private boolean _active;
351 }