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