001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.impl.BaseModelImpl;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.portlet.journal.model.JournalFeed;
029:
030: import com.liferay.util.Html;
031:
032: import java.io.Serializable;
033:
034: import java.lang.reflect.Proxy;
035:
036: import java.sql.Types;
037:
038: import java.util.Date;
039:
040: /**
041: * <a href="JournalFeedModelImpl.java.html"><b><i>View Source</i></b></a>
042: *
043: * <p>
044: * ServiceBuilder generated this class. Modifications in this class will be
045: * overwritten the next time is generated.
046: * </p>
047: *
048: * <p>
049: * This class is a model that represents the <code>JournalFeed</code> table
050: * in the database.
051: * </p>
052: *
053: * @author Brian Wing Shun Chan
054: *
055: * @see com.liferay.portlet.journal.service.model.JournalFeed
056: * @see com.liferay.portlet.journal.service.model.JournalFeedModel
057: * @see com.liferay.portlet.journal.service.model.impl.JournalFeedImpl
058: *
059: */
060: public class JournalFeedModelImpl extends BaseModelImpl {
061: public static final String TABLE_NAME = "JournalFeed";
062: public static final Object[][] TABLE_COLUMNS = {
063: { "uuid_", new Integer(Types.VARCHAR) },
064:
065: { "id_", new Integer(Types.BIGINT) },
066:
067: { "groupId", new Integer(Types.BIGINT) },
068:
069: { "companyId", new Integer(Types.BIGINT) },
070:
071: { "userId", new Integer(Types.BIGINT) },
072:
073: { "userName", new Integer(Types.VARCHAR) },
074:
075: { "createDate", new Integer(Types.TIMESTAMP) },
076:
077: { "modifiedDate", new Integer(Types.TIMESTAMP) },
078:
079: { "feedId", new Integer(Types.VARCHAR) },
080:
081: { "name", new Integer(Types.VARCHAR) },
082:
083: { "description", new Integer(Types.VARCHAR) },
084:
085: { "type_", new Integer(Types.VARCHAR) },
086:
087: { "structureId", new Integer(Types.VARCHAR) },
088:
089: { "templateId", new Integer(Types.VARCHAR) },
090:
091: { "rendererTemplateId", new Integer(Types.VARCHAR) },
092:
093: { "delta", new Integer(Types.INTEGER) },
094:
095: { "orderByCol", new Integer(Types.VARCHAR) },
096:
097: { "orderByType", new Integer(Types.VARCHAR) },
098:
099: { "targetLayoutFriendlyUrl", new Integer(Types.VARCHAR) },
100:
101: { "targetPortletId", new Integer(Types.VARCHAR) },
102:
103: { "contentField", new Integer(Types.VARCHAR) },
104:
105: { "feedType", new Integer(Types.VARCHAR) },
106:
107: { "feedVersion", new Integer(Types.DOUBLE) } };
108: public static final String TABLE_SQL_CREATE = "create table JournalFeed (uuid_ VARCHAR(75) null,id_ LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,feedId VARCHAR(75) null,name VARCHAR(75) null,description STRING null,type_ VARCHAR(75) null,structureId VARCHAR(75) null,templateId VARCHAR(75) null,rendererTemplateId VARCHAR(75) null,delta INTEGER,orderByCol VARCHAR(75) null,orderByType VARCHAR(75) null,targetLayoutFriendlyUrl VARCHAR(75) null,targetPortletId VARCHAR(75) null,contentField VARCHAR(75) null,feedType VARCHAR(75) null,feedVersion DOUBLE)";
109: public static final String TABLE_SQL_DROP = "drop table JournalFeed";
110: public static final boolean CACHE_ENABLED = GetterUtil
111: .getBoolean(
112: PropsUtil
113: .get("value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalFeed"),
114: true);
115: public static final long LOCK_EXPIRATION_TIME = GetterUtil
116: .getLong(PropsUtil
117: .get("lock.expiration.time.com.liferay.portlet.journal.model.JournalFeed"));
118:
119: public JournalFeedModelImpl() {
120: }
121:
122: public long getPrimaryKey() {
123: return _id;
124: }
125:
126: public void setPrimaryKey(long pk) {
127: setId(pk);
128: }
129:
130: public Serializable getPrimaryKeyObj() {
131: return new Long(_id);
132: }
133:
134: public String getUuid() {
135: return GetterUtil.getString(_uuid);
136: }
137:
138: public void setUuid(String uuid) {
139: if ((uuid != null) && (uuid != _uuid)) {
140: _uuid = uuid;
141: }
142: }
143:
144: public long getId() {
145: return _id;
146: }
147:
148: public void setId(long id) {
149: if (id != _id) {
150: _id = id;
151: }
152: }
153:
154: public long getGroupId() {
155: return _groupId;
156: }
157:
158: public void setGroupId(long groupId) {
159: if (groupId != _groupId) {
160: _groupId = groupId;
161: }
162: }
163:
164: public long getCompanyId() {
165: return _companyId;
166: }
167:
168: public void setCompanyId(long companyId) {
169: if (companyId != _companyId) {
170: _companyId = companyId;
171: }
172: }
173:
174: public long getUserId() {
175: return _userId;
176: }
177:
178: public void setUserId(long userId) {
179: if (userId != _userId) {
180: _userId = userId;
181: }
182: }
183:
184: public String getUserName() {
185: return GetterUtil.getString(_userName);
186: }
187:
188: public void setUserName(String userName) {
189: if (((userName == null) && (_userName != null))
190: || ((userName != null) && (_userName == null))
191: || ((userName != null) && (_userName != null) && !userName
192: .equals(_userName))) {
193: _userName = userName;
194: }
195: }
196:
197: public Date getCreateDate() {
198: return _createDate;
199: }
200:
201: public void setCreateDate(Date createDate) {
202: if (((createDate == null) && (_createDate != null))
203: || ((createDate != null) && (_createDate == null))
204: || ((createDate != null) && (_createDate != null) && !createDate
205: .equals(_createDate))) {
206: _createDate = createDate;
207: }
208: }
209:
210: public Date getModifiedDate() {
211: return _modifiedDate;
212: }
213:
214: public void setModifiedDate(Date modifiedDate) {
215: if (((modifiedDate == null) && (_modifiedDate != null))
216: || ((modifiedDate != null) && (_modifiedDate == null))
217: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
218: .equals(_modifiedDate))) {
219: _modifiedDate = modifiedDate;
220: }
221: }
222:
223: public String getFeedId() {
224: return GetterUtil.getString(_feedId);
225: }
226:
227: public void setFeedId(String feedId) {
228: if (((feedId == null) && (_feedId != null))
229: || ((feedId != null) && (_feedId == null))
230: || ((feedId != null) && (_feedId != null) && !feedId
231: .equals(_feedId))) {
232: _feedId = feedId;
233: }
234: }
235:
236: public String getName() {
237: return GetterUtil.getString(_name);
238: }
239:
240: public void setName(String name) {
241: if (((name == null) && (_name != null))
242: || ((name != null) && (_name == null))
243: || ((name != null) && (_name != null) && !name
244: .equals(_name))) {
245: _name = name;
246: }
247: }
248:
249: public String getDescription() {
250: return GetterUtil.getString(_description);
251: }
252:
253: public void setDescription(String description) {
254: if (((description == null) && (_description != null))
255: || ((description != null) && (_description == null))
256: || ((description != null) && (_description != null) && !description
257: .equals(_description))) {
258: _description = description;
259: }
260: }
261:
262: public String getType() {
263: return GetterUtil.getString(_type);
264: }
265:
266: public void setType(String type) {
267: if (((type == null) && (_type != null))
268: || ((type != null) && (_type == null))
269: || ((type != null) && (_type != null) && !type
270: .equals(_type))) {
271: _type = type;
272: }
273: }
274:
275: public String getStructureId() {
276: return GetterUtil.getString(_structureId);
277: }
278:
279: public void setStructureId(String structureId) {
280: if (((structureId == null) && (_structureId != null))
281: || ((structureId != null) && (_structureId == null))
282: || ((structureId != null) && (_structureId != null) && !structureId
283: .equals(_structureId))) {
284: _structureId = structureId;
285: }
286: }
287:
288: public String getTemplateId() {
289: return GetterUtil.getString(_templateId);
290: }
291:
292: public void setTemplateId(String templateId) {
293: if (((templateId == null) && (_templateId != null))
294: || ((templateId != null) && (_templateId == null))
295: || ((templateId != null) && (_templateId != null) && !templateId
296: .equals(_templateId))) {
297: _templateId = templateId;
298: }
299: }
300:
301: public String getRendererTemplateId() {
302: return GetterUtil.getString(_rendererTemplateId);
303: }
304:
305: public void setRendererTemplateId(String rendererTemplateId) {
306: if (((rendererTemplateId == null) && (_rendererTemplateId != null))
307: || ((rendererTemplateId != null) && (_rendererTemplateId == null))
308: || ((rendererTemplateId != null)
309: && (_rendererTemplateId != null) && !rendererTemplateId
310: .equals(_rendererTemplateId))) {
311: _rendererTemplateId = rendererTemplateId;
312: }
313: }
314:
315: public int getDelta() {
316: return _delta;
317: }
318:
319: public void setDelta(int delta) {
320: if (delta != _delta) {
321: _delta = delta;
322: }
323: }
324:
325: public String getOrderByCol() {
326: return GetterUtil.getString(_orderByCol);
327: }
328:
329: public void setOrderByCol(String orderByCol) {
330: if (((orderByCol == null) && (_orderByCol != null))
331: || ((orderByCol != null) && (_orderByCol == null))
332: || ((orderByCol != null) && (_orderByCol != null) && !orderByCol
333: .equals(_orderByCol))) {
334: _orderByCol = orderByCol;
335: }
336: }
337:
338: public String getOrderByType() {
339: return GetterUtil.getString(_orderByType);
340: }
341:
342: public void setOrderByType(String orderByType) {
343: if (((orderByType == null) && (_orderByType != null))
344: || ((orderByType != null) && (_orderByType == null))
345: || ((orderByType != null) && (_orderByType != null) && !orderByType
346: .equals(_orderByType))) {
347: _orderByType = orderByType;
348: }
349: }
350:
351: public String getTargetLayoutFriendlyUrl() {
352: return GetterUtil.getString(_targetLayoutFriendlyUrl);
353: }
354:
355: public void setTargetLayoutFriendlyUrl(
356: String targetLayoutFriendlyUrl) {
357: if (((targetLayoutFriendlyUrl == null) && (_targetLayoutFriendlyUrl != null))
358: || ((targetLayoutFriendlyUrl != null) && (_targetLayoutFriendlyUrl == null))
359: || ((targetLayoutFriendlyUrl != null)
360: && (_targetLayoutFriendlyUrl != null) && !targetLayoutFriendlyUrl
361: .equals(_targetLayoutFriendlyUrl))) {
362: _targetLayoutFriendlyUrl = targetLayoutFriendlyUrl;
363: }
364: }
365:
366: public String getTargetPortletId() {
367: return GetterUtil.getString(_targetPortletId);
368: }
369:
370: public void setTargetPortletId(String targetPortletId) {
371: if (((targetPortletId == null) && (_targetPortletId != null))
372: || ((targetPortletId != null) && (_targetPortletId == null))
373: || ((targetPortletId != null)
374: && (_targetPortletId != null) && !targetPortletId
375: .equals(_targetPortletId))) {
376: _targetPortletId = targetPortletId;
377: }
378: }
379:
380: public String getContentField() {
381: return GetterUtil.getString(_contentField);
382: }
383:
384: public void setContentField(String contentField) {
385: if (((contentField == null) && (_contentField != null))
386: || ((contentField != null) && (_contentField == null))
387: || ((contentField != null) && (_contentField != null) && !contentField
388: .equals(_contentField))) {
389: _contentField = contentField;
390: }
391: }
392:
393: public String getFeedType() {
394: return GetterUtil.getString(_feedType);
395: }
396:
397: public void setFeedType(String feedType) {
398: if (((feedType == null) && (_feedType != null))
399: || ((feedType != null) && (_feedType == null))
400: || ((feedType != null) && (_feedType != null) && !feedType
401: .equals(_feedType))) {
402: _feedType = feedType;
403: }
404: }
405:
406: public double getFeedVersion() {
407: return _feedVersion;
408: }
409:
410: public void setFeedVersion(double feedVersion) {
411: if (feedVersion != _feedVersion) {
412: _feedVersion = feedVersion;
413: }
414: }
415:
416: public JournalFeed toEscapedModel() {
417: if (isEscapedModel()) {
418: return (JournalFeed) this ;
419: } else {
420: JournalFeed model = new JournalFeedImpl();
421:
422: model.setEscapedModel(true);
423:
424: model.setUuid(Html.escape(getUuid()));
425: model.setId(getId());
426: model.setGroupId(getGroupId());
427: model.setCompanyId(getCompanyId());
428: model.setUserId(getUserId());
429: model.setUserName(Html.escape(getUserName()));
430: model.setCreateDate(getCreateDate());
431: model.setModifiedDate(getModifiedDate());
432: model.setFeedId(getFeedId());
433: model.setName(Html.escape(getName()));
434: model.setDescription(Html.escape(getDescription()));
435: model.setType(Html.escape(getType()));
436: model.setStructureId(getStructureId());
437: model.setTemplateId(getTemplateId());
438: model.setRendererTemplateId(Html
439: .escape(getRendererTemplateId()));
440: model.setDelta(getDelta());
441: model.setOrderByCol(Html.escape(getOrderByCol()));
442: model.setOrderByType(Html.escape(getOrderByType()));
443: model.setTargetLayoutFriendlyUrl(Html
444: .escape(getTargetLayoutFriendlyUrl()));
445: model.setTargetPortletId(Html.escape(getTargetPortletId()));
446: model.setContentField(Html.escape(getContentField()));
447: model.setFeedType(Html.escape(getFeedType()));
448: model.setFeedVersion(getFeedVersion());
449:
450: model = (JournalFeed) Proxy.newProxyInstance(
451: JournalFeed.class.getClassLoader(),
452: new Class[] { JournalFeed.class },
453: new ReadOnlyBeanHandler(model));
454:
455: return model;
456: }
457: }
458:
459: public Object clone() {
460: JournalFeedImpl clone = new JournalFeedImpl();
461:
462: clone.setUuid(getUuid());
463: clone.setId(getId());
464: clone.setGroupId(getGroupId());
465: clone.setCompanyId(getCompanyId());
466: clone.setUserId(getUserId());
467: clone.setUserName(getUserName());
468: clone.setCreateDate(getCreateDate());
469: clone.setModifiedDate(getModifiedDate());
470: clone.setFeedId(getFeedId());
471: clone.setName(getName());
472: clone.setDescription(getDescription());
473: clone.setType(getType());
474: clone.setStructureId(getStructureId());
475: clone.setTemplateId(getTemplateId());
476: clone.setRendererTemplateId(getRendererTemplateId());
477: clone.setDelta(getDelta());
478: clone.setOrderByCol(getOrderByCol());
479: clone.setOrderByType(getOrderByType());
480: clone.setTargetLayoutFriendlyUrl(getTargetLayoutFriendlyUrl());
481: clone.setTargetPortletId(getTargetPortletId());
482: clone.setContentField(getContentField());
483: clone.setFeedType(getFeedType());
484: clone.setFeedVersion(getFeedVersion());
485:
486: return clone;
487: }
488:
489: public int compareTo(Object obj) {
490: if (obj == null) {
491: return -1;
492: }
493:
494: JournalFeedImpl journalFeed = (JournalFeedImpl) obj;
495:
496: int value = 0;
497:
498: value = getFeedId().compareTo(journalFeed.getFeedId());
499:
500: if (value != 0) {
501: return value;
502: }
503:
504: return 0;
505: }
506:
507: public boolean equals(Object obj) {
508: if (obj == null) {
509: return false;
510: }
511:
512: JournalFeedImpl journalFeed = null;
513:
514: try {
515: journalFeed = (JournalFeedImpl) obj;
516: } catch (ClassCastException cce) {
517: return false;
518: }
519:
520: long pk = journalFeed.getPrimaryKey();
521:
522: if (getPrimaryKey() == pk) {
523: return true;
524: } else {
525: return false;
526: }
527: }
528:
529: public int hashCode() {
530: return (int) getPrimaryKey();
531: }
532:
533: private String _uuid;
534: private long _id;
535: private long _groupId;
536: private long _companyId;
537: private long _userId;
538: private String _userName;
539: private Date _createDate;
540: private Date _modifiedDate;
541: private String _feedId;
542: private String _name;
543: private String _description;
544: private String _type;
545: private String _structureId;
546: private String _templateId;
547: private String _rendererTemplateId;
548: private int _delta;
549: private String _orderByCol;
550: private String _orderByType;
551: private String _targetLayoutFriendlyUrl;
552: private String _targetPortletId;
553: private String _contentField;
554: private String _feedType;
555: private double _feedVersion;
556: }
|