001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.model.CacheModel;
025    import com.liferay.portal.model.impl.BaseModelImpl;
026    import com.liferay.portal.service.ServiceContext;
027    import com.liferay.portal.util.PortalUtil;
028    
029    import com.liferay.portlet.expando.model.ExpandoBridge;
030    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
031    import com.liferay.portlet.journal.model.JournalFeed;
032    import com.liferay.portlet.journal.model.JournalFeedModel;
033    import com.liferay.portlet.journal.model.JournalFeedSoap;
034    
035    import java.io.Serializable;
036    
037    import java.sql.Types;
038    
039    import java.util.ArrayList;
040    import java.util.Date;
041    import java.util.HashMap;
042    import java.util.List;
043    import java.util.Map;
044    
045    /**
046     * The base model implementation for the JournalFeed service. Represents a row in the "JournalFeed" database table, with each column mapped to a property of this class.
047     *
048     * <p>
049     * This implementation and its corresponding interface {@link com.liferay.portlet.journal.model.JournalFeedModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link JournalFeedImpl}.
050     * </p>
051     *
052     * @author Brian Wing Shun Chan
053     * @see JournalFeedImpl
054     * @see com.liferay.portlet.journal.model.JournalFeed
055     * @see com.liferay.portlet.journal.model.JournalFeedModel
056     * @generated
057     */
058    @JSON(strict = true)
059    public class JournalFeedModelImpl extends BaseModelImpl<JournalFeed>
060            implements JournalFeedModel {
061            /*
062             * NOTE FOR DEVELOPERS:
063             *
064             * Never modify or reference this class directly. All methods that expect a journal feed model instance should use the {@link com.liferay.portlet.journal.model.JournalFeed} interface instead.
065             */
066            public static final String TABLE_NAME = "JournalFeed";
067            public static final Object[][] TABLE_COLUMNS = {
068                            { "uuid_", Types.VARCHAR },
069                            { "id_", Types.BIGINT },
070                            { "groupId", Types.BIGINT },
071                            { "companyId", Types.BIGINT },
072                            { "userId", Types.BIGINT },
073                            { "userName", Types.VARCHAR },
074                            { "createDate", Types.TIMESTAMP },
075                            { "modifiedDate", Types.TIMESTAMP },
076                            { "feedId", Types.VARCHAR },
077                            { "name", Types.VARCHAR },
078                            { "description", Types.VARCHAR },
079                            { "type_", Types.VARCHAR },
080                            { "structureId", Types.VARCHAR },
081                            { "templateId", Types.VARCHAR },
082                            { "rendererTemplateId", Types.VARCHAR },
083                            { "delta", Types.INTEGER },
084                            { "orderByCol", Types.VARCHAR },
085                            { "orderByType", Types.VARCHAR },
086                            { "targetLayoutFriendlyUrl", Types.VARCHAR },
087                            { "targetPortletId", Types.VARCHAR },
088                            { "contentField", Types.VARCHAR },
089                            { "feedType", Types.VARCHAR },
090                            { "feedVersion", Types.DOUBLE }
091                    };
092            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(255) null,targetPortletId VARCHAR(75) null,contentField VARCHAR(75) null,feedType VARCHAR(75) null,feedVersion DOUBLE)";
093            public static final String TABLE_SQL_DROP = "drop table JournalFeed";
094            public static final String ORDER_BY_JPQL = " ORDER BY journalFeed.feedId ASC";
095            public static final String ORDER_BY_SQL = " ORDER BY JournalFeed.feedId ASC";
096            public static final String DATA_SOURCE = "liferayDataSource";
097            public static final String SESSION_FACTORY = "liferaySessionFactory";
098            public static final String TX_MANAGER = "liferayTransactionManager";
099            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
100                                    "value.object.entity.cache.enabled.com.liferay.portlet.journal.model.JournalFeed"),
101                            true);
102            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
103                                    "value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalFeed"),
104                            true);
105            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
106                                    "value.object.column.bitmask.enabled.com.liferay.portlet.journal.model.JournalFeed"),
107                            true);
108            public static long COMPANYID_COLUMN_BITMASK = 1L;
109            public static long FEEDID_COLUMN_BITMASK = 2L;
110            public static long GROUPID_COLUMN_BITMASK = 4L;
111            public static long UUID_COLUMN_BITMASK = 8L;
112    
113            /**
114             * Converts the soap model instance into a normal model instance.
115             *
116             * @param soapModel the soap model instance to convert
117             * @return the normal model instance
118             */
119            public static JournalFeed toModel(JournalFeedSoap soapModel) {
120                    if (soapModel == null) {
121                            return null;
122                    }
123    
124                    JournalFeed model = new JournalFeedImpl();
125    
126                    model.setUuid(soapModel.getUuid());
127                    model.setId(soapModel.getId());
128                    model.setGroupId(soapModel.getGroupId());
129                    model.setCompanyId(soapModel.getCompanyId());
130                    model.setUserId(soapModel.getUserId());
131                    model.setUserName(soapModel.getUserName());
132                    model.setCreateDate(soapModel.getCreateDate());
133                    model.setModifiedDate(soapModel.getModifiedDate());
134                    model.setFeedId(soapModel.getFeedId());
135                    model.setName(soapModel.getName());
136                    model.setDescription(soapModel.getDescription());
137                    model.setType(soapModel.getType());
138                    model.setStructureId(soapModel.getStructureId());
139                    model.setTemplateId(soapModel.getTemplateId());
140                    model.setRendererTemplateId(soapModel.getRendererTemplateId());
141                    model.setDelta(soapModel.getDelta());
142                    model.setOrderByCol(soapModel.getOrderByCol());
143                    model.setOrderByType(soapModel.getOrderByType());
144                    model.setTargetLayoutFriendlyUrl(soapModel.getTargetLayoutFriendlyUrl());
145                    model.setTargetPortletId(soapModel.getTargetPortletId());
146                    model.setContentField(soapModel.getContentField());
147                    model.setFeedType(soapModel.getFeedType());
148                    model.setFeedVersion(soapModel.getFeedVersion());
149    
150                    return model;
151            }
152    
153            /**
154             * Converts the soap model instances into normal model instances.
155             *
156             * @param soapModels the soap model instances to convert
157             * @return the normal model instances
158             */
159            public static List<JournalFeed> toModels(JournalFeedSoap[] soapModels) {
160                    if (soapModels == null) {
161                            return null;
162                    }
163    
164                    List<JournalFeed> models = new ArrayList<JournalFeed>(soapModels.length);
165    
166                    for (JournalFeedSoap soapModel : soapModels) {
167                            models.add(toModel(soapModel));
168                    }
169    
170                    return models;
171            }
172    
173            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
174                                    "lock.expiration.time.com.liferay.portlet.journal.model.JournalFeed"));
175    
176            public JournalFeedModelImpl() {
177            }
178    
179            public long getPrimaryKey() {
180                    return _id;
181            }
182    
183            public void setPrimaryKey(long primaryKey) {
184                    setId(primaryKey);
185            }
186    
187            public Serializable getPrimaryKeyObj() {
188                    return new Long(_id);
189            }
190    
191            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
192                    setPrimaryKey(((Long)primaryKeyObj).longValue());
193            }
194    
195            public Class<?> getModelClass() {
196                    return JournalFeed.class;
197            }
198    
199            public String getModelClassName() {
200                    return JournalFeed.class.getName();
201            }
202    
203            @Override
204            public Map<String, Object> getModelAttributes() {
205                    Map<String, Object> attributes = new HashMap<String, Object>();
206    
207                    attributes.put("uuid", getUuid());
208                    attributes.put("id", getId());
209                    attributes.put("groupId", getGroupId());
210                    attributes.put("companyId", getCompanyId());
211                    attributes.put("userId", getUserId());
212                    attributes.put("userName", getUserName());
213                    attributes.put("createDate", getCreateDate());
214                    attributes.put("modifiedDate", getModifiedDate());
215                    attributes.put("feedId", getFeedId());
216                    attributes.put("name", getName());
217                    attributes.put("description", getDescription());
218                    attributes.put("type", getType());
219                    attributes.put("structureId", getStructureId());
220                    attributes.put("templateId", getTemplateId());
221                    attributes.put("rendererTemplateId", getRendererTemplateId());
222                    attributes.put("delta", getDelta());
223                    attributes.put("orderByCol", getOrderByCol());
224                    attributes.put("orderByType", getOrderByType());
225                    attributes.put("targetLayoutFriendlyUrl", getTargetLayoutFriendlyUrl());
226                    attributes.put("targetPortletId", getTargetPortletId());
227                    attributes.put("contentField", getContentField());
228                    attributes.put("feedType", getFeedType());
229                    attributes.put("feedVersion", getFeedVersion());
230    
231                    return attributes;
232            }
233    
234            @Override
235            public void setModelAttributes(Map<String, Object> attributes) {
236                    String uuid = (String)attributes.get("uuid");
237    
238                    if (uuid != null) {
239                            setUuid(uuid);
240                    }
241    
242                    Long id = (Long)attributes.get("id");
243    
244                    if (id != null) {
245                            setId(id);
246                    }
247    
248                    Long groupId = (Long)attributes.get("groupId");
249    
250                    if (groupId != null) {
251                            setGroupId(groupId);
252                    }
253    
254                    Long companyId = (Long)attributes.get("companyId");
255    
256                    if (companyId != null) {
257                            setCompanyId(companyId);
258                    }
259    
260                    Long userId = (Long)attributes.get("userId");
261    
262                    if (userId != null) {
263                            setUserId(userId);
264                    }
265    
266                    String userName = (String)attributes.get("userName");
267    
268                    if (userName != null) {
269                            setUserName(userName);
270                    }
271    
272                    Date createDate = (Date)attributes.get("createDate");
273    
274                    if (createDate != null) {
275                            setCreateDate(createDate);
276                    }
277    
278                    Date modifiedDate = (Date)attributes.get("modifiedDate");
279    
280                    if (modifiedDate != null) {
281                            setModifiedDate(modifiedDate);
282                    }
283    
284                    String feedId = (String)attributes.get("feedId");
285    
286                    if (feedId != null) {
287                            setFeedId(feedId);
288                    }
289    
290                    String name = (String)attributes.get("name");
291    
292                    if (name != null) {
293                            setName(name);
294                    }
295    
296                    String description = (String)attributes.get("description");
297    
298                    if (description != null) {
299                            setDescription(description);
300                    }
301    
302                    String type = (String)attributes.get("type");
303    
304                    if (type != null) {
305                            setType(type);
306                    }
307    
308                    String structureId = (String)attributes.get("structureId");
309    
310                    if (structureId != null) {
311                            setStructureId(structureId);
312                    }
313    
314                    String templateId = (String)attributes.get("templateId");
315    
316                    if (templateId != null) {
317                            setTemplateId(templateId);
318                    }
319    
320                    String rendererTemplateId = (String)attributes.get("rendererTemplateId");
321    
322                    if (rendererTemplateId != null) {
323                            setRendererTemplateId(rendererTemplateId);
324                    }
325    
326                    Integer delta = (Integer)attributes.get("delta");
327    
328                    if (delta != null) {
329                            setDelta(delta);
330                    }
331    
332                    String orderByCol = (String)attributes.get("orderByCol");
333    
334                    if (orderByCol != null) {
335                            setOrderByCol(orderByCol);
336                    }
337    
338                    String orderByType = (String)attributes.get("orderByType");
339    
340                    if (orderByType != null) {
341                            setOrderByType(orderByType);
342                    }
343    
344                    String targetLayoutFriendlyUrl = (String)attributes.get(
345                                    "targetLayoutFriendlyUrl");
346    
347                    if (targetLayoutFriendlyUrl != null) {
348                            setTargetLayoutFriendlyUrl(targetLayoutFriendlyUrl);
349                    }
350    
351                    String targetPortletId = (String)attributes.get("targetPortletId");
352    
353                    if (targetPortletId != null) {
354                            setTargetPortletId(targetPortletId);
355                    }
356    
357                    String contentField = (String)attributes.get("contentField");
358    
359                    if (contentField != null) {
360                            setContentField(contentField);
361                    }
362    
363                    String feedType = (String)attributes.get("feedType");
364    
365                    if (feedType != null) {
366                            setFeedType(feedType);
367                    }
368    
369                    Double feedVersion = (Double)attributes.get("feedVersion");
370    
371                    if (feedVersion != null) {
372                            setFeedVersion(feedVersion);
373                    }
374            }
375    
376            @JSON
377            public String getUuid() {
378                    if (_uuid == null) {
379                            return StringPool.BLANK;
380                    }
381                    else {
382                            return _uuid;
383                    }
384            }
385    
386            public void setUuid(String uuid) {
387                    if (_originalUuid == null) {
388                            _originalUuid = _uuid;
389                    }
390    
391                    _uuid = uuid;
392            }
393    
394            public String getOriginalUuid() {
395                    return GetterUtil.getString(_originalUuid);
396            }
397    
398            @JSON
399            public long getId() {
400                    return _id;
401            }
402    
403            public void setId(long id) {
404                    _id = id;
405            }
406    
407            @JSON
408            public long getGroupId() {
409                    return _groupId;
410            }
411    
412            public void setGroupId(long groupId) {
413                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
414    
415                    if (!_setOriginalGroupId) {
416                            _setOriginalGroupId = true;
417    
418                            _originalGroupId = _groupId;
419                    }
420    
421                    _groupId = groupId;
422            }
423    
424            public long getOriginalGroupId() {
425                    return _originalGroupId;
426            }
427    
428            @JSON
429            public long getCompanyId() {
430                    return _companyId;
431            }
432    
433            public void setCompanyId(long companyId) {
434                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
435    
436                    if (!_setOriginalCompanyId) {
437                            _setOriginalCompanyId = true;
438    
439                            _originalCompanyId = _companyId;
440                    }
441    
442                    _companyId = companyId;
443            }
444    
445            public long getOriginalCompanyId() {
446                    return _originalCompanyId;
447            }
448    
449            @JSON
450            public long getUserId() {
451                    return _userId;
452            }
453    
454            public void setUserId(long userId) {
455                    _userId = userId;
456            }
457    
458            public String getUserUuid() throws SystemException {
459                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
460            }
461    
462            public void setUserUuid(String userUuid) {
463                    _userUuid = userUuid;
464            }
465    
466            @JSON
467            public String getUserName() {
468                    if (_userName == null) {
469                            return StringPool.BLANK;
470                    }
471                    else {
472                            return _userName;
473                    }
474            }
475    
476            public void setUserName(String userName) {
477                    _userName = userName;
478            }
479    
480            @JSON
481            public Date getCreateDate() {
482                    return _createDate;
483            }
484    
485            public void setCreateDate(Date createDate) {
486                    _createDate = createDate;
487            }
488    
489            @JSON
490            public Date getModifiedDate() {
491                    return _modifiedDate;
492            }
493    
494            public void setModifiedDate(Date modifiedDate) {
495                    _modifiedDate = modifiedDate;
496            }
497    
498            @JSON
499            public String getFeedId() {
500                    if (_feedId == null) {
501                            return StringPool.BLANK;
502                    }
503                    else {
504                            return _feedId;
505                    }
506            }
507    
508            public void setFeedId(String feedId) {
509                    _columnBitmask = -1L;
510    
511                    if (_originalFeedId == null) {
512                            _originalFeedId = _feedId;
513                    }
514    
515                    _feedId = feedId;
516            }
517    
518            public String getOriginalFeedId() {
519                    return GetterUtil.getString(_originalFeedId);
520            }
521    
522            @JSON
523            public String getName() {
524                    if (_name == null) {
525                            return StringPool.BLANK;
526                    }
527                    else {
528                            return _name;
529                    }
530            }
531    
532            public void setName(String name) {
533                    _name = name;
534            }
535    
536            @JSON
537            public String getDescription() {
538                    if (_description == null) {
539                            return StringPool.BLANK;
540                    }
541                    else {
542                            return _description;
543                    }
544            }
545    
546            public void setDescription(String description) {
547                    _description = description;
548            }
549    
550            @JSON
551            public String getType() {
552                    if (_type == null) {
553                            return StringPool.BLANK;
554                    }
555                    else {
556                            return _type;
557                    }
558            }
559    
560            public void setType(String type) {
561                    _type = type;
562            }
563    
564            @JSON
565            public String getStructureId() {
566                    if (_structureId == null) {
567                            return StringPool.BLANK;
568                    }
569                    else {
570                            return _structureId;
571                    }
572            }
573    
574            public void setStructureId(String structureId) {
575                    _structureId = structureId;
576            }
577    
578            @JSON
579            public String getTemplateId() {
580                    if (_templateId == null) {
581                            return StringPool.BLANK;
582                    }
583                    else {
584                            return _templateId;
585                    }
586            }
587    
588            public void setTemplateId(String templateId) {
589                    _templateId = templateId;
590            }
591    
592            @JSON
593            public String getRendererTemplateId() {
594                    if (_rendererTemplateId == null) {
595                            return StringPool.BLANK;
596                    }
597                    else {
598                            return _rendererTemplateId;
599                    }
600            }
601    
602            public void setRendererTemplateId(String rendererTemplateId) {
603                    _rendererTemplateId = rendererTemplateId;
604            }
605    
606            @JSON
607            public int getDelta() {
608                    return _delta;
609            }
610    
611            public void setDelta(int delta) {
612                    _delta = delta;
613            }
614    
615            @JSON
616            public String getOrderByCol() {
617                    if (_orderByCol == null) {
618                            return StringPool.BLANK;
619                    }
620                    else {
621                            return _orderByCol;
622                    }
623            }
624    
625            public void setOrderByCol(String orderByCol) {
626                    _orderByCol = orderByCol;
627            }
628    
629            @JSON
630            public String getOrderByType() {
631                    if (_orderByType == null) {
632                            return StringPool.BLANK;
633                    }
634                    else {
635                            return _orderByType;
636                    }
637            }
638    
639            public void setOrderByType(String orderByType) {
640                    _orderByType = orderByType;
641            }
642    
643            @JSON
644            public String getTargetLayoutFriendlyUrl() {
645                    if (_targetLayoutFriendlyUrl == null) {
646                            return StringPool.BLANK;
647                    }
648                    else {
649                            return _targetLayoutFriendlyUrl;
650                    }
651            }
652    
653            public void setTargetLayoutFriendlyUrl(String targetLayoutFriendlyUrl) {
654                    _targetLayoutFriendlyUrl = targetLayoutFriendlyUrl;
655            }
656    
657            @JSON
658            public String getTargetPortletId() {
659                    if (_targetPortletId == null) {
660                            return StringPool.BLANK;
661                    }
662                    else {
663                            return _targetPortletId;
664                    }
665            }
666    
667            public void setTargetPortletId(String targetPortletId) {
668                    _targetPortletId = targetPortletId;
669            }
670    
671            @JSON
672            public String getContentField() {
673                    if (_contentField == null) {
674                            return StringPool.BLANK;
675                    }
676                    else {
677                            return _contentField;
678                    }
679            }
680    
681            public void setContentField(String contentField) {
682                    _contentField = contentField;
683            }
684    
685            @JSON
686            public String getFeedType() {
687                    if (_feedType == null) {
688                            return StringPool.BLANK;
689                    }
690                    else {
691                            return _feedType;
692                    }
693            }
694    
695            public void setFeedType(String feedType) {
696                    _feedType = feedType;
697            }
698    
699            @JSON
700            public double getFeedVersion() {
701                    return _feedVersion;
702            }
703    
704            public void setFeedVersion(double feedVersion) {
705                    _feedVersion = feedVersion;
706            }
707    
708            public long getColumnBitmask() {
709                    return _columnBitmask;
710            }
711    
712            @Override
713            public ExpandoBridge getExpandoBridge() {
714                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
715                            JournalFeed.class.getName(), getPrimaryKey());
716            }
717    
718            @Override
719            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
720                    ExpandoBridge expandoBridge = getExpandoBridge();
721    
722                    expandoBridge.setAttributes(serviceContext);
723            }
724    
725            @Override
726            public JournalFeed toEscapedModel() {
727                    if (_escapedModelProxy == null) {
728                            _escapedModelProxy = (JournalFeed)ProxyUtil.newProxyInstance(_classLoader,
729                                            _escapedModelProxyInterfaces,
730                                            new AutoEscapeBeanHandler(this));
731                    }
732    
733                    return _escapedModelProxy;
734            }
735    
736            @Override
737            public Object clone() {
738                    JournalFeedImpl journalFeedImpl = new JournalFeedImpl();
739    
740                    journalFeedImpl.setUuid(getUuid());
741                    journalFeedImpl.setId(getId());
742                    journalFeedImpl.setGroupId(getGroupId());
743                    journalFeedImpl.setCompanyId(getCompanyId());
744                    journalFeedImpl.setUserId(getUserId());
745                    journalFeedImpl.setUserName(getUserName());
746                    journalFeedImpl.setCreateDate(getCreateDate());
747                    journalFeedImpl.setModifiedDate(getModifiedDate());
748                    journalFeedImpl.setFeedId(getFeedId());
749                    journalFeedImpl.setName(getName());
750                    journalFeedImpl.setDescription(getDescription());
751                    journalFeedImpl.setType(getType());
752                    journalFeedImpl.setStructureId(getStructureId());
753                    journalFeedImpl.setTemplateId(getTemplateId());
754                    journalFeedImpl.setRendererTemplateId(getRendererTemplateId());
755                    journalFeedImpl.setDelta(getDelta());
756                    journalFeedImpl.setOrderByCol(getOrderByCol());
757                    journalFeedImpl.setOrderByType(getOrderByType());
758                    journalFeedImpl.setTargetLayoutFriendlyUrl(getTargetLayoutFriendlyUrl());
759                    journalFeedImpl.setTargetPortletId(getTargetPortletId());
760                    journalFeedImpl.setContentField(getContentField());
761                    journalFeedImpl.setFeedType(getFeedType());
762                    journalFeedImpl.setFeedVersion(getFeedVersion());
763    
764                    journalFeedImpl.resetOriginalValues();
765    
766                    return journalFeedImpl;
767            }
768    
769            public int compareTo(JournalFeed journalFeed) {
770                    int value = 0;
771    
772                    value = getFeedId().compareTo(journalFeed.getFeedId());
773    
774                    if (value != 0) {
775                            return value;
776                    }
777    
778                    return 0;
779            }
780    
781            @Override
782            public boolean equals(Object obj) {
783                    if (obj == null) {
784                            return false;
785                    }
786    
787                    JournalFeed journalFeed = null;
788    
789                    try {
790                            journalFeed = (JournalFeed)obj;
791                    }
792                    catch (ClassCastException cce) {
793                            return false;
794                    }
795    
796                    long primaryKey = journalFeed.getPrimaryKey();
797    
798                    if (getPrimaryKey() == primaryKey) {
799                            return true;
800                    }
801                    else {
802                            return false;
803                    }
804            }
805    
806            @Override
807            public int hashCode() {
808                    return (int)getPrimaryKey();
809            }
810    
811            @Override
812            public void resetOriginalValues() {
813                    JournalFeedModelImpl journalFeedModelImpl = this;
814    
815                    journalFeedModelImpl._originalUuid = journalFeedModelImpl._uuid;
816    
817                    journalFeedModelImpl._originalGroupId = journalFeedModelImpl._groupId;
818    
819                    journalFeedModelImpl._setOriginalGroupId = false;
820    
821                    journalFeedModelImpl._originalCompanyId = journalFeedModelImpl._companyId;
822    
823                    journalFeedModelImpl._setOriginalCompanyId = false;
824    
825                    journalFeedModelImpl._originalFeedId = journalFeedModelImpl._feedId;
826    
827                    journalFeedModelImpl._columnBitmask = 0;
828            }
829    
830            @Override
831            public CacheModel<JournalFeed> toCacheModel() {
832                    JournalFeedCacheModel journalFeedCacheModel = new JournalFeedCacheModel();
833    
834                    journalFeedCacheModel.uuid = getUuid();
835    
836                    String uuid = journalFeedCacheModel.uuid;
837    
838                    if ((uuid != null) && (uuid.length() == 0)) {
839                            journalFeedCacheModel.uuid = null;
840                    }
841    
842                    journalFeedCacheModel.id = getId();
843    
844                    journalFeedCacheModel.groupId = getGroupId();
845    
846                    journalFeedCacheModel.companyId = getCompanyId();
847    
848                    journalFeedCacheModel.userId = getUserId();
849    
850                    journalFeedCacheModel.userName = getUserName();
851    
852                    String userName = journalFeedCacheModel.userName;
853    
854                    if ((userName != null) && (userName.length() == 0)) {
855                            journalFeedCacheModel.userName = null;
856                    }
857    
858                    Date createDate = getCreateDate();
859    
860                    if (createDate != null) {
861                            journalFeedCacheModel.createDate = createDate.getTime();
862                    }
863                    else {
864                            journalFeedCacheModel.createDate = Long.MIN_VALUE;
865                    }
866    
867                    Date modifiedDate = getModifiedDate();
868    
869                    if (modifiedDate != null) {
870                            journalFeedCacheModel.modifiedDate = modifiedDate.getTime();
871                    }
872                    else {
873                            journalFeedCacheModel.modifiedDate = Long.MIN_VALUE;
874                    }
875    
876                    journalFeedCacheModel.feedId = getFeedId();
877    
878                    String feedId = journalFeedCacheModel.feedId;
879    
880                    if ((feedId != null) && (feedId.length() == 0)) {
881                            journalFeedCacheModel.feedId = null;
882                    }
883    
884                    journalFeedCacheModel.name = getName();
885    
886                    String name = journalFeedCacheModel.name;
887    
888                    if ((name != null) && (name.length() == 0)) {
889                            journalFeedCacheModel.name = null;
890                    }
891    
892                    journalFeedCacheModel.description = getDescription();
893    
894                    String description = journalFeedCacheModel.description;
895    
896                    if ((description != null) && (description.length() == 0)) {
897                            journalFeedCacheModel.description = null;
898                    }
899    
900                    journalFeedCacheModel.type = getType();
901    
902                    String type = journalFeedCacheModel.type;
903    
904                    if ((type != null) && (type.length() == 0)) {
905                            journalFeedCacheModel.type = null;
906                    }
907    
908                    journalFeedCacheModel.structureId = getStructureId();
909    
910                    String structureId = journalFeedCacheModel.structureId;
911    
912                    if ((structureId != null) && (structureId.length() == 0)) {
913                            journalFeedCacheModel.structureId = null;
914                    }
915    
916                    journalFeedCacheModel.templateId = getTemplateId();
917    
918                    String templateId = journalFeedCacheModel.templateId;
919    
920                    if ((templateId != null) && (templateId.length() == 0)) {
921                            journalFeedCacheModel.templateId = null;
922                    }
923    
924                    journalFeedCacheModel.rendererTemplateId = getRendererTemplateId();
925    
926                    String rendererTemplateId = journalFeedCacheModel.rendererTemplateId;
927    
928                    if ((rendererTemplateId != null) && (rendererTemplateId.length() == 0)) {
929                            journalFeedCacheModel.rendererTemplateId = null;
930                    }
931    
932                    journalFeedCacheModel.delta = getDelta();
933    
934                    journalFeedCacheModel.orderByCol = getOrderByCol();
935    
936                    String orderByCol = journalFeedCacheModel.orderByCol;
937    
938                    if ((orderByCol != null) && (orderByCol.length() == 0)) {
939                            journalFeedCacheModel.orderByCol = null;
940                    }
941    
942                    journalFeedCacheModel.orderByType = getOrderByType();
943    
944                    String orderByType = journalFeedCacheModel.orderByType;
945    
946                    if ((orderByType != null) && (orderByType.length() == 0)) {
947                            journalFeedCacheModel.orderByType = null;
948                    }
949    
950                    journalFeedCacheModel.targetLayoutFriendlyUrl = getTargetLayoutFriendlyUrl();
951    
952                    String targetLayoutFriendlyUrl = journalFeedCacheModel.targetLayoutFriendlyUrl;
953    
954                    if ((targetLayoutFriendlyUrl != null) &&
955                                    (targetLayoutFriendlyUrl.length() == 0)) {
956                            journalFeedCacheModel.targetLayoutFriendlyUrl = null;
957                    }
958    
959                    journalFeedCacheModel.targetPortletId = getTargetPortletId();
960    
961                    String targetPortletId = journalFeedCacheModel.targetPortletId;
962    
963                    if ((targetPortletId != null) && (targetPortletId.length() == 0)) {
964                            journalFeedCacheModel.targetPortletId = null;
965                    }
966    
967                    journalFeedCacheModel.contentField = getContentField();
968    
969                    String contentField = journalFeedCacheModel.contentField;
970    
971                    if ((contentField != null) && (contentField.length() == 0)) {
972                            journalFeedCacheModel.contentField = null;
973                    }
974    
975                    journalFeedCacheModel.feedType = getFeedType();
976    
977                    String feedType = journalFeedCacheModel.feedType;
978    
979                    if ((feedType != null) && (feedType.length() == 0)) {
980                            journalFeedCacheModel.feedType = null;
981                    }
982    
983                    journalFeedCacheModel.feedVersion = getFeedVersion();
984    
985                    return journalFeedCacheModel;
986            }
987    
988            @Override
989            public String toString() {
990                    StringBundler sb = new StringBundler(47);
991    
992                    sb.append("{uuid=");
993                    sb.append(getUuid());
994                    sb.append(", id=");
995                    sb.append(getId());
996                    sb.append(", groupId=");
997                    sb.append(getGroupId());
998                    sb.append(", companyId=");
999                    sb.append(getCompanyId());
1000                    sb.append(", userId=");
1001                    sb.append(getUserId());
1002                    sb.append(", userName=");
1003                    sb.append(getUserName());
1004                    sb.append(", createDate=");
1005                    sb.append(getCreateDate());
1006                    sb.append(", modifiedDate=");
1007                    sb.append(getModifiedDate());
1008                    sb.append(", feedId=");
1009                    sb.append(getFeedId());
1010                    sb.append(", name=");
1011                    sb.append(getName());
1012                    sb.append(", description=");
1013                    sb.append(getDescription());
1014                    sb.append(", type=");
1015                    sb.append(getType());
1016                    sb.append(", structureId=");
1017                    sb.append(getStructureId());
1018                    sb.append(", templateId=");
1019                    sb.append(getTemplateId());
1020                    sb.append(", rendererTemplateId=");
1021                    sb.append(getRendererTemplateId());
1022                    sb.append(", delta=");
1023                    sb.append(getDelta());
1024                    sb.append(", orderByCol=");
1025                    sb.append(getOrderByCol());
1026                    sb.append(", orderByType=");
1027                    sb.append(getOrderByType());
1028                    sb.append(", targetLayoutFriendlyUrl=");
1029                    sb.append(getTargetLayoutFriendlyUrl());
1030                    sb.append(", targetPortletId=");
1031                    sb.append(getTargetPortletId());
1032                    sb.append(", contentField=");
1033                    sb.append(getContentField());
1034                    sb.append(", feedType=");
1035                    sb.append(getFeedType());
1036                    sb.append(", feedVersion=");
1037                    sb.append(getFeedVersion());
1038                    sb.append("}");
1039    
1040                    return sb.toString();
1041            }
1042    
1043            public String toXmlString() {
1044                    StringBundler sb = new StringBundler(73);
1045    
1046                    sb.append("<model><model-name>");
1047                    sb.append("com.liferay.portlet.journal.model.JournalFeed");
1048                    sb.append("</model-name>");
1049    
1050                    sb.append(
1051                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1052                    sb.append(getUuid());
1053                    sb.append("]]></column-value></column>");
1054                    sb.append(
1055                            "<column><column-name>id</column-name><column-value><![CDATA[");
1056                    sb.append(getId());
1057                    sb.append("]]></column-value></column>");
1058                    sb.append(
1059                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1060                    sb.append(getGroupId());
1061                    sb.append("]]></column-value></column>");
1062                    sb.append(
1063                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1064                    sb.append(getCompanyId());
1065                    sb.append("]]></column-value></column>");
1066                    sb.append(
1067                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1068                    sb.append(getUserId());
1069                    sb.append("]]></column-value></column>");
1070                    sb.append(
1071                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1072                    sb.append(getUserName());
1073                    sb.append("]]></column-value></column>");
1074                    sb.append(
1075                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1076                    sb.append(getCreateDate());
1077                    sb.append("]]></column-value></column>");
1078                    sb.append(
1079                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1080                    sb.append(getModifiedDate());
1081                    sb.append("]]></column-value></column>");
1082                    sb.append(
1083                            "<column><column-name>feedId</column-name><column-value><![CDATA[");
1084                    sb.append(getFeedId());
1085                    sb.append("]]></column-value></column>");
1086                    sb.append(
1087                            "<column><column-name>name</column-name><column-value><![CDATA[");
1088                    sb.append(getName());
1089                    sb.append("]]></column-value></column>");
1090                    sb.append(
1091                            "<column><column-name>description</column-name><column-value><![CDATA[");
1092                    sb.append(getDescription());
1093                    sb.append("]]></column-value></column>");
1094                    sb.append(
1095                            "<column><column-name>type</column-name><column-value><![CDATA[");
1096                    sb.append(getType());
1097                    sb.append("]]></column-value></column>");
1098                    sb.append(
1099                            "<column><column-name>structureId</column-name><column-value><![CDATA[");
1100                    sb.append(getStructureId());
1101                    sb.append("]]></column-value></column>");
1102                    sb.append(
1103                            "<column><column-name>templateId</column-name><column-value><![CDATA[");
1104                    sb.append(getTemplateId());
1105                    sb.append("]]></column-value></column>");
1106                    sb.append(
1107                            "<column><column-name>rendererTemplateId</column-name><column-value><![CDATA[");
1108                    sb.append(getRendererTemplateId());
1109                    sb.append("]]></column-value></column>");
1110                    sb.append(
1111                            "<column><column-name>delta</column-name><column-value><![CDATA[");
1112                    sb.append(getDelta());
1113                    sb.append("]]></column-value></column>");
1114                    sb.append(
1115                            "<column><column-name>orderByCol</column-name><column-value><![CDATA[");
1116                    sb.append(getOrderByCol());
1117                    sb.append("]]></column-value></column>");
1118                    sb.append(
1119                            "<column><column-name>orderByType</column-name><column-value><![CDATA[");
1120                    sb.append(getOrderByType());
1121                    sb.append("]]></column-value></column>");
1122                    sb.append(
1123                            "<column><column-name>targetLayoutFriendlyUrl</column-name><column-value><![CDATA[");
1124                    sb.append(getTargetLayoutFriendlyUrl());
1125                    sb.append("]]></column-value></column>");
1126                    sb.append(
1127                            "<column><column-name>targetPortletId</column-name><column-value><![CDATA[");
1128                    sb.append(getTargetPortletId());
1129                    sb.append("]]></column-value></column>");
1130                    sb.append(
1131                            "<column><column-name>contentField</column-name><column-value><![CDATA[");
1132                    sb.append(getContentField());
1133                    sb.append("]]></column-value></column>");
1134                    sb.append(
1135                            "<column><column-name>feedType</column-name><column-value><![CDATA[");
1136                    sb.append(getFeedType());
1137                    sb.append("]]></column-value></column>");
1138                    sb.append(
1139                            "<column><column-name>feedVersion</column-name><column-value><![CDATA[");
1140                    sb.append(getFeedVersion());
1141                    sb.append("]]></column-value></column>");
1142    
1143                    sb.append("</model>");
1144    
1145                    return sb.toString();
1146            }
1147    
1148            private static ClassLoader _classLoader = JournalFeed.class.getClassLoader();
1149            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
1150                            JournalFeed.class
1151                    };
1152            private String _uuid;
1153            private String _originalUuid;
1154            private long _id;
1155            private long _groupId;
1156            private long _originalGroupId;
1157            private boolean _setOriginalGroupId;
1158            private long _companyId;
1159            private long _originalCompanyId;
1160            private boolean _setOriginalCompanyId;
1161            private long _userId;
1162            private String _userUuid;
1163            private String _userName;
1164            private Date _createDate;
1165            private Date _modifiedDate;
1166            private String _feedId;
1167            private String _originalFeedId;
1168            private String _name;
1169            private String _description;
1170            private String _type;
1171            private String _structureId;
1172            private String _templateId;
1173            private String _rendererTemplateId;
1174            private int _delta;
1175            private String _orderByCol;
1176            private String _orderByType;
1177            private String _targetLayoutFriendlyUrl;
1178            private String _targetPortletId;
1179            private String _contentField;
1180            private String _feedType;
1181            private double _feedVersion;
1182            private long _columnBitmask;
1183            private JournalFeed _escapedModelProxy;
1184    }