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