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