1
22
23 package com.liferay.portlet.tags.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.kernel.util.HtmlUtil;
28 import com.liferay.portal.model.impl.BaseModelImpl;
29
30 import com.liferay.portlet.tags.model.TagsProperty;
31 import com.liferay.portlet.tags.model.TagsPropertySoap;
32
33 import java.io.Serializable;
34
35 import java.lang.reflect.Proxy;
36
37 import java.sql.Types;
38
39 import java.util.ArrayList;
40 import java.util.Date;
41 import java.util.List;
42
43
63 public class TagsPropertyModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "TagsProperty";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "propertyId", new Integer(Types.BIGINT) },
67
68
69 { "companyId", new Integer(Types.BIGINT) },
70
71
72 { "userId", new Integer(Types.BIGINT) },
73
74
75 { "userName", new Integer(Types.VARCHAR) },
76
77
78 { "createDate", new Integer(Types.TIMESTAMP) },
79
80
81 { "modifiedDate", new Integer(Types.TIMESTAMP) },
82
83
84 { "entryId", new Integer(Types.BIGINT) },
85
86
87 { "key_", new Integer(Types.VARCHAR) },
88
89
90 { "value", new Integer(Types.VARCHAR) }
91 };
92 public static final 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)";
93 public static final String TABLE_SQL_DROP = "drop table TagsProperty";
94 public static final String DATA_SOURCE = "liferayDataSource";
95 public static final String SESSION_FACTORY = "liferaySessionFactory";
96 public static final String TX_MANAGER = "liferayTransactionManager";
97 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
98 "value.object.finder.cache.enabled.com.liferay.portlet.tags.model.TagsProperty"),
99 true);
100
101 public static TagsProperty toModel(TagsPropertySoap soapModel) {
102 TagsProperty model = new TagsPropertyImpl();
103
104 model.setPropertyId(soapModel.getPropertyId());
105 model.setCompanyId(soapModel.getCompanyId());
106 model.setUserId(soapModel.getUserId());
107 model.setUserName(soapModel.getUserName());
108 model.setCreateDate(soapModel.getCreateDate());
109 model.setModifiedDate(soapModel.getModifiedDate());
110 model.setEntryId(soapModel.getEntryId());
111 model.setKey(soapModel.getKey());
112 model.setValue(soapModel.getValue());
113
114 return model;
115 }
116
117 public static List<TagsProperty> toModels(TagsPropertySoap[] soapModels) {
118 List<TagsProperty> models = new ArrayList<TagsProperty>(soapModels.length);
119
120 for (TagsPropertySoap soapModel : soapModels) {
121 models.add(toModel(soapModel));
122 }
123
124 return models;
125 }
126
127 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
128 "lock.expiration.time.com.liferay.portlet.tags.model.TagsProperty"));
129
130 public TagsPropertyModelImpl() {
131 }
132
133 public long getPrimaryKey() {
134 return _propertyId;
135 }
136
137 public void setPrimaryKey(long pk) {
138 setPropertyId(pk);
139 }
140
141 public Serializable getPrimaryKeyObj() {
142 return new Long(_propertyId);
143 }
144
145 public long getPropertyId() {
146 return _propertyId;
147 }
148
149 public void setPropertyId(long propertyId) {
150 if (propertyId != _propertyId) {
151 _propertyId = propertyId;
152 }
153 }
154
155 public long getCompanyId() {
156 return _companyId;
157 }
158
159 public void setCompanyId(long companyId) {
160 if (companyId != _companyId) {
161 _companyId = companyId;
162 }
163 }
164
165 public long getUserId() {
166 return _userId;
167 }
168
169 public void setUserId(long userId) {
170 if (userId != _userId) {
171 _userId = userId;
172 }
173 }
174
175 public String getUserName() {
176 return GetterUtil.getString(_userName);
177 }
178
179 public void setUserName(String userName) {
180 if (((userName == null) && (_userName != null)) ||
181 ((userName != null) && (_userName == null)) ||
182 ((userName != null) && (_userName != null) &&
183 !userName.equals(_userName))) {
184 _userName = userName;
185 }
186 }
187
188 public Date getCreateDate() {
189 return _createDate;
190 }
191
192 public void setCreateDate(Date createDate) {
193 if (((createDate == null) && (_createDate != null)) ||
194 ((createDate != null) && (_createDate == null)) ||
195 ((createDate != null) && (_createDate != null) &&
196 !createDate.equals(_createDate))) {
197 _createDate = createDate;
198 }
199 }
200
201 public Date getModifiedDate() {
202 return _modifiedDate;
203 }
204
205 public void setModifiedDate(Date modifiedDate) {
206 if (((modifiedDate == null) && (_modifiedDate != null)) ||
207 ((modifiedDate != null) && (_modifiedDate == null)) ||
208 ((modifiedDate != null) && (_modifiedDate != null) &&
209 !modifiedDate.equals(_modifiedDate))) {
210 _modifiedDate = modifiedDate;
211 }
212 }
213
214 public long getEntryId() {
215 return _entryId;
216 }
217
218 public void setEntryId(long entryId) {
219 if (entryId != _entryId) {
220 _entryId = entryId;
221 }
222 }
223
224 public String getKey() {
225 return GetterUtil.getString(_key);
226 }
227
228 public void setKey(String key) {
229 if (((key == null) && (_key != null)) ||
230 ((key != null) && (_key == null)) ||
231 ((key != null) && (_key != null) && !key.equals(_key))) {
232 _key = key;
233 }
234 }
235
236 public String getValue() {
237 return GetterUtil.getString(_value);
238 }
239
240 public void setValue(String value) {
241 if (((value == null) && (_value != null)) ||
242 ((value != null) && (_value == null)) ||
243 ((value != null) && (_value != null) && !value.equals(_value))) {
244 _value = value;
245 }
246 }
247
248 public TagsProperty toEscapedModel() {
249 if (isEscapedModel()) {
250 return (TagsProperty)this;
251 }
252 else {
253 TagsProperty model = new TagsPropertyImpl();
254
255 model.setNew(isNew());
256 model.setEscapedModel(true);
257
258 model.setPropertyId(getPropertyId());
259 model.setCompanyId(getCompanyId());
260 model.setUserId(getUserId());
261 model.setUserName(HtmlUtil.escape(getUserName()));
262 model.setCreateDate(getCreateDate());
263 model.setModifiedDate(getModifiedDate());
264 model.setEntryId(getEntryId());
265 model.setKey(HtmlUtil.escape(getKey()));
266 model.setValue(HtmlUtil.escape(getValue()));
267
268 model = (TagsProperty)Proxy.newProxyInstance(TagsProperty.class.getClassLoader(),
269 new Class[] { TagsProperty.class },
270 new ReadOnlyBeanHandler(model));
271
272 return model;
273 }
274 }
275
276 public Object clone() {
277 TagsPropertyImpl clone = new TagsPropertyImpl();
278
279 clone.setPropertyId(getPropertyId());
280 clone.setCompanyId(getCompanyId());
281 clone.setUserId(getUserId());
282 clone.setUserName(getUserName());
283 clone.setCreateDate(getCreateDate());
284 clone.setModifiedDate(getModifiedDate());
285 clone.setEntryId(getEntryId());
286 clone.setKey(getKey());
287 clone.setValue(getValue());
288
289 return clone;
290 }
291
292 public int compareTo(Object obj) {
293 if (obj == null) {
294 return -1;
295 }
296
297 TagsPropertyImpl tagsProperty = (TagsPropertyImpl)obj;
298
299 int value = 0;
300
301 value = getKey().compareTo(tagsProperty.getKey());
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 TagsPropertyImpl tagsProperty = null;
316
317 try {
318 tagsProperty = (TagsPropertyImpl)obj;
319 }
320 catch (ClassCastException cce) {
321 return false;
322 }
323
324 long pk = tagsProperty.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 _propertyId;
339 private long _companyId;
340 private long _userId;
341 private String _userName;
342 private Date _createDate;
343 private Date _modifiedDate;
344 private long _entryId;
345 private String _key;
346 private String _value;
347 }