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