1
22
23 package com.liferay.portlet.tags.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 import java.util.Date;
36
37
57 public class TagsPropertyModelImpl extends BaseModelImpl {
58 public static String TABLE_NAME = "TagsProperty";
59 public static Object[][] TABLE_COLUMNS = {
60 { "propertyId", new Integer(Types.BIGINT) },
61 { "companyId", new Integer(Types.BIGINT) },
62 { "userId", new Integer(Types.BIGINT) },
63 { "userName", new Integer(Types.VARCHAR) },
64 { "createDate", new Integer(Types.TIMESTAMP) },
65 { "modifiedDate", new Integer(Types.TIMESTAMP) },
66 { "entryId", new Integer(Types.BIGINT) },
67 { "key_", new Integer(Types.VARCHAR) },
68 { "value", new Integer(Types.VARCHAR) }
69 };
70 public static String TABLE_SQL_CREATE = "create table TagsProperty (propertyId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,entryId LONG,key_ VARCHAR(75) null,value VARCHAR(300) null)";
71 public static String TABLE_SQL_DROP = "drop table TagsProperty";
72 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
73 "xss.allow.com.liferay.portlet.tags.model.TagsProperty"),
74 XSS_ALLOW);
75 public static boolean XSS_ALLOW_USERNAME = GetterUtil.getBoolean(PropsUtil.get(
76 "xss.allow.com.liferay.portlet.tags.model.TagsProperty.userName"),
77 XSS_ALLOW_BY_MODEL);
78 public static boolean XSS_ALLOW_KEY = GetterUtil.getBoolean(PropsUtil.get(
79 "xss.allow.com.liferay.portlet.tags.model.TagsProperty.key"),
80 XSS_ALLOW_BY_MODEL);
81 public static boolean XSS_ALLOW_VALUE = GetterUtil.getBoolean(PropsUtil.get(
82 "xss.allow.com.liferay.portlet.tags.model.TagsProperty.value"),
83 XSS_ALLOW_BY_MODEL);
84 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
85 "lock.expiration.time.com.liferay.portlet.tags.model.TagsPropertyModel"));
86
87 public TagsPropertyModelImpl() {
88 }
89
90 public long getPrimaryKey() {
91 return _propertyId;
92 }
93
94 public void setPrimaryKey(long pk) {
95 setPropertyId(pk);
96 }
97
98 public Serializable getPrimaryKeyObj() {
99 return new Long(_propertyId);
100 }
101
102 public long getPropertyId() {
103 return _propertyId;
104 }
105
106 public void setPropertyId(long propertyId) {
107 if (propertyId != _propertyId) {
108 _propertyId = propertyId;
109 }
110 }
111
112 public long getCompanyId() {
113 return _companyId;
114 }
115
116 public void setCompanyId(long companyId) {
117 if (companyId != _companyId) {
118 _companyId = companyId;
119 }
120 }
121
122 public long getUserId() {
123 return _userId;
124 }
125
126 public void setUserId(long userId) {
127 if (userId != _userId) {
128 _userId = userId;
129 }
130 }
131
132 public String getUserName() {
133 return GetterUtil.getString(_userName);
134 }
135
136 public void setUserName(String userName) {
137 if (((userName == null) && (_userName != null)) ||
138 ((userName != null) && (_userName == null)) ||
139 ((userName != null) && (_userName != null) &&
140 !userName.equals(_userName))) {
141 if (!XSS_ALLOW_USERNAME) {
142 userName = XSSUtil.strip(userName);
143 }
144
145 _userName = userName;
146 }
147 }
148
149 public Date getCreateDate() {
150 return _createDate;
151 }
152
153 public void setCreateDate(Date createDate) {
154 if (((createDate == null) && (_createDate != null)) ||
155 ((createDate != null) && (_createDate == null)) ||
156 ((createDate != null) && (_createDate != null) &&
157 !createDate.equals(_createDate))) {
158 _createDate = createDate;
159 }
160 }
161
162 public Date getModifiedDate() {
163 return _modifiedDate;
164 }
165
166 public void setModifiedDate(Date modifiedDate) {
167 if (((modifiedDate == null) && (_modifiedDate != null)) ||
168 ((modifiedDate != null) && (_modifiedDate == null)) ||
169 ((modifiedDate != null) && (_modifiedDate != null) &&
170 !modifiedDate.equals(_modifiedDate))) {
171 _modifiedDate = modifiedDate;
172 }
173 }
174
175 public long getEntryId() {
176 return _entryId;
177 }
178
179 public void setEntryId(long entryId) {
180 if (entryId != _entryId) {
181 _entryId = entryId;
182 }
183 }
184
185 public String getKey() {
186 return GetterUtil.getString(_key);
187 }
188
189 public void setKey(String key) {
190 if (((key == null) && (_key != null)) ||
191 ((key != null) && (_key == null)) ||
192 ((key != null) && (_key != null) && !key.equals(_key))) {
193 if (!XSS_ALLOW_KEY) {
194 key = XSSUtil.strip(key);
195 }
196
197 _key = key;
198 }
199 }
200
201 public String getValue() {
202 return GetterUtil.getString(_value);
203 }
204
205 public void setValue(String value) {
206 if (((value == null) && (_value != null)) ||
207 ((value != null) && (_value == null)) ||
208 ((value != null) && (_value != null) && !value.equals(_value))) {
209 if (!XSS_ALLOW_VALUE) {
210 value = XSSUtil.strip(value);
211 }
212
213 _value = value;
214 }
215 }
216
217 public Object clone() {
218 TagsPropertyImpl clone = new TagsPropertyImpl();
219 clone.setPropertyId(getPropertyId());
220 clone.setCompanyId(getCompanyId());
221 clone.setUserId(getUserId());
222 clone.setUserName(getUserName());
223 clone.setCreateDate(getCreateDate());
224 clone.setModifiedDate(getModifiedDate());
225 clone.setEntryId(getEntryId());
226 clone.setKey(getKey());
227 clone.setValue(getValue());
228
229 return clone;
230 }
231
232 public int compareTo(Object obj) {
233 if (obj == null) {
234 return -1;
235 }
236
237 TagsPropertyImpl tagsProperty = (TagsPropertyImpl)obj;
238 int value = 0;
239 value = getKey().compareTo(tagsProperty.getKey());
240
241 if (value != 0) {
242 return value;
243 }
244
245 return 0;
246 }
247
248 public boolean equals(Object obj) {
249 if (obj == null) {
250 return false;
251 }
252
253 TagsPropertyImpl tagsProperty = null;
254
255 try {
256 tagsProperty = (TagsPropertyImpl)obj;
257 }
258 catch (ClassCastException cce) {
259 return false;
260 }
261
262 long pk = tagsProperty.getPrimaryKey();
263
264 if (getPrimaryKey() == pk) {
265 return true;
266 }
267 else {
268 return false;
269 }
270 }
271
272 public int hashCode() {
273 return (int)getPrimaryKey();
274 }
275
276 private long _propertyId;
277 private long _companyId;
278 private long _userId;
279 private String _userName;
280 private Date _createDate;
281 private Date _modifiedDate;
282 private long _entryId;
283 private String _key;
284 private String _value;
285 }