001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.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 STRING 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                            return true;
767                    }
768                    else {
769                            return false;
770                    }
771            }
772    
773            public boolean isExpired() {
774                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
775                            return true;
776                    }
777                    else {
778                            return false;
779                    }
780            }
781    
782            public boolean isInactive() {
783                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
784                            return true;
785                    }
786                    else {
787                            return false;
788                    }
789            }
790    
791            public boolean isIncomplete() {
792                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
793                            return true;
794                    }
795                    else {
796                            return false;
797                    }
798            }
799    
800            public boolean isInTrash() {
801                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
802                            return true;
803                    }
804                    else {
805                            return false;
806                    }
807            }
808    
809            public boolean isPending() {
810                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
811                            return true;
812                    }
813                    else {
814                            return false;
815                    }
816            }
817    
818            public boolean isScheduled() {
819                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
820                            return true;
821                    }
822                    else {
823                            return false;
824                    }
825            }
826    
827            public long getColumnBitmask() {
828                    return _columnBitmask;
829            }
830    
831            @Override
832            public ExpandoBridge getExpandoBridge() {
833                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
834                            BlogsEntry.class.getName(), getPrimaryKey());
835            }
836    
837            @Override
838            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
839                    ExpandoBridge expandoBridge = getExpandoBridge();
840    
841                    expandoBridge.setAttributes(serviceContext);
842            }
843    
844            @Override
845            public BlogsEntry toEscapedModel() {
846                    if (_escapedModelProxy == null) {
847                            _escapedModelProxy = (BlogsEntry)ProxyUtil.newProxyInstance(_classLoader,
848                                            _escapedModelProxyInterfaces,
849                                            new AutoEscapeBeanHandler(this));
850                    }
851    
852                    return _escapedModelProxy;
853            }
854    
855            @Override
856            public Object clone() {
857                    BlogsEntryImpl blogsEntryImpl = new BlogsEntryImpl();
858    
859                    blogsEntryImpl.setUuid(getUuid());
860                    blogsEntryImpl.setEntryId(getEntryId());
861                    blogsEntryImpl.setGroupId(getGroupId());
862                    blogsEntryImpl.setCompanyId(getCompanyId());
863                    blogsEntryImpl.setUserId(getUserId());
864                    blogsEntryImpl.setUserName(getUserName());
865                    blogsEntryImpl.setCreateDate(getCreateDate());
866                    blogsEntryImpl.setModifiedDate(getModifiedDate());
867                    blogsEntryImpl.setTitle(getTitle());
868                    blogsEntryImpl.setUrlTitle(getUrlTitle());
869                    blogsEntryImpl.setDescription(getDescription());
870                    blogsEntryImpl.setContent(getContent());
871                    blogsEntryImpl.setDisplayDate(getDisplayDate());
872                    blogsEntryImpl.setAllowPingbacks(getAllowPingbacks());
873                    blogsEntryImpl.setAllowTrackbacks(getAllowTrackbacks());
874                    blogsEntryImpl.setTrackbacks(getTrackbacks());
875                    blogsEntryImpl.setSmallImage(getSmallImage());
876                    blogsEntryImpl.setSmallImageId(getSmallImageId());
877                    blogsEntryImpl.setSmallImageURL(getSmallImageURL());
878                    blogsEntryImpl.setStatus(getStatus());
879                    blogsEntryImpl.setStatusByUserId(getStatusByUserId());
880                    blogsEntryImpl.setStatusByUserName(getStatusByUserName());
881                    blogsEntryImpl.setStatusDate(getStatusDate());
882    
883                    blogsEntryImpl.resetOriginalValues();
884    
885                    return blogsEntryImpl;
886            }
887    
888            public int compareTo(BlogsEntry blogsEntry) {
889                    int value = 0;
890    
891                    value = DateUtil.compareTo(getDisplayDate(), blogsEntry.getDisplayDate());
892    
893                    value = value * -1;
894    
895                    if (value != 0) {
896                            return value;
897                    }
898    
899                    value = DateUtil.compareTo(getCreateDate(), blogsEntry.getCreateDate());
900    
901                    value = value * -1;
902    
903                    if (value != 0) {
904                            return value;
905                    }
906    
907                    return 0;
908            }
909    
910            @Override
911            public boolean equals(Object obj) {
912                    if (obj == null) {
913                            return false;
914                    }
915    
916                    BlogsEntry blogsEntry = null;
917    
918                    try {
919                            blogsEntry = (BlogsEntry)obj;
920                    }
921                    catch (ClassCastException cce) {
922                            return false;
923                    }
924    
925                    long primaryKey = blogsEntry.getPrimaryKey();
926    
927                    if (getPrimaryKey() == primaryKey) {
928                            return true;
929                    }
930                    else {
931                            return false;
932                    }
933            }
934    
935            @Override
936            public int hashCode() {
937                    return (int)getPrimaryKey();
938            }
939    
940            @Override
941            public void resetOriginalValues() {
942                    BlogsEntryModelImpl blogsEntryModelImpl = this;
943    
944                    blogsEntryModelImpl._originalUuid = blogsEntryModelImpl._uuid;
945    
946                    blogsEntryModelImpl._originalGroupId = blogsEntryModelImpl._groupId;
947    
948                    blogsEntryModelImpl._setOriginalGroupId = false;
949    
950                    blogsEntryModelImpl._originalCompanyId = blogsEntryModelImpl._companyId;
951    
952                    blogsEntryModelImpl._setOriginalCompanyId = false;
953    
954                    blogsEntryModelImpl._originalUserId = blogsEntryModelImpl._userId;
955    
956                    blogsEntryModelImpl._setOriginalUserId = false;
957    
958                    blogsEntryModelImpl._originalUrlTitle = blogsEntryModelImpl._urlTitle;
959    
960                    blogsEntryModelImpl._originalDisplayDate = blogsEntryModelImpl._displayDate;
961    
962                    blogsEntryModelImpl._originalStatus = blogsEntryModelImpl._status;
963    
964                    blogsEntryModelImpl._setOriginalStatus = false;
965    
966                    blogsEntryModelImpl._columnBitmask = 0;
967            }
968    
969            @Override
970            public CacheModel<BlogsEntry> toCacheModel() {
971                    BlogsEntryCacheModel blogsEntryCacheModel = new BlogsEntryCacheModel();
972    
973                    blogsEntryCacheModel.uuid = getUuid();
974    
975                    String uuid = blogsEntryCacheModel.uuid;
976    
977                    if ((uuid != null) && (uuid.length() == 0)) {
978                            blogsEntryCacheModel.uuid = null;
979                    }
980    
981                    blogsEntryCacheModel.entryId = getEntryId();
982    
983                    blogsEntryCacheModel.groupId = getGroupId();
984    
985                    blogsEntryCacheModel.companyId = getCompanyId();
986    
987                    blogsEntryCacheModel.userId = getUserId();
988    
989                    blogsEntryCacheModel.userName = getUserName();
990    
991                    String userName = blogsEntryCacheModel.userName;
992    
993                    if ((userName != null) && (userName.length() == 0)) {
994                            blogsEntryCacheModel.userName = null;
995                    }
996    
997                    Date createDate = getCreateDate();
998    
999                    if (createDate != null) {
1000                            blogsEntryCacheModel.createDate = createDate.getTime();
1001                    }
1002                    else {
1003                            blogsEntryCacheModel.createDate = Long.MIN_VALUE;
1004                    }
1005    
1006                    Date modifiedDate = getModifiedDate();
1007    
1008                    if (modifiedDate != null) {
1009                            blogsEntryCacheModel.modifiedDate = modifiedDate.getTime();
1010                    }
1011                    else {
1012                            blogsEntryCacheModel.modifiedDate = Long.MIN_VALUE;
1013                    }
1014    
1015                    blogsEntryCacheModel.title = getTitle();
1016    
1017                    String title = blogsEntryCacheModel.title;
1018    
1019                    if ((title != null) && (title.length() == 0)) {
1020                            blogsEntryCacheModel.title = null;
1021                    }
1022    
1023                    blogsEntryCacheModel.urlTitle = getUrlTitle();
1024    
1025                    String urlTitle = blogsEntryCacheModel.urlTitle;
1026    
1027                    if ((urlTitle != null) && (urlTitle.length() == 0)) {
1028                            blogsEntryCacheModel.urlTitle = null;
1029                    }
1030    
1031                    blogsEntryCacheModel.description = getDescription();
1032    
1033                    String description = blogsEntryCacheModel.description;
1034    
1035                    if ((description != null) && (description.length() == 0)) {
1036                            blogsEntryCacheModel.description = null;
1037                    }
1038    
1039                    blogsEntryCacheModel.content = getContent();
1040    
1041                    String content = blogsEntryCacheModel.content;
1042    
1043                    if ((content != null) && (content.length() == 0)) {
1044                            blogsEntryCacheModel.content = null;
1045                    }
1046    
1047                    Date displayDate = getDisplayDate();
1048    
1049                    if (displayDate != null) {
1050                            blogsEntryCacheModel.displayDate = displayDate.getTime();
1051                    }
1052                    else {
1053                            blogsEntryCacheModel.displayDate = Long.MIN_VALUE;
1054                    }
1055    
1056                    blogsEntryCacheModel.allowPingbacks = getAllowPingbacks();
1057    
1058                    blogsEntryCacheModel.allowTrackbacks = getAllowTrackbacks();
1059    
1060                    blogsEntryCacheModel.trackbacks = getTrackbacks();
1061    
1062                    String trackbacks = blogsEntryCacheModel.trackbacks;
1063    
1064                    if ((trackbacks != null) && (trackbacks.length() == 0)) {
1065                            blogsEntryCacheModel.trackbacks = null;
1066                    }
1067    
1068                    blogsEntryCacheModel.smallImage = getSmallImage();
1069    
1070                    blogsEntryCacheModel.smallImageId = getSmallImageId();
1071    
1072                    blogsEntryCacheModel.smallImageURL = getSmallImageURL();
1073    
1074                    String smallImageURL = blogsEntryCacheModel.smallImageURL;
1075    
1076                    if ((smallImageURL != null) && (smallImageURL.length() == 0)) {
1077                            blogsEntryCacheModel.smallImageURL = null;
1078                    }
1079    
1080                    blogsEntryCacheModel.status = getStatus();
1081    
1082                    blogsEntryCacheModel.statusByUserId = getStatusByUserId();
1083    
1084                    blogsEntryCacheModel.statusByUserName = getStatusByUserName();
1085    
1086                    String statusByUserName = blogsEntryCacheModel.statusByUserName;
1087    
1088                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1089                            blogsEntryCacheModel.statusByUserName = null;
1090                    }
1091    
1092                    Date statusDate = getStatusDate();
1093    
1094                    if (statusDate != null) {
1095                            blogsEntryCacheModel.statusDate = statusDate.getTime();
1096                    }
1097                    else {
1098                            blogsEntryCacheModel.statusDate = Long.MIN_VALUE;
1099                    }
1100    
1101                    return blogsEntryCacheModel;
1102            }
1103    
1104            @Override
1105            public String toString() {
1106                    StringBundler sb = new StringBundler(47);
1107    
1108                    sb.append("{uuid=");
1109                    sb.append(getUuid());
1110                    sb.append(", entryId=");
1111                    sb.append(getEntryId());
1112                    sb.append(", groupId=");
1113                    sb.append(getGroupId());
1114                    sb.append(", companyId=");
1115                    sb.append(getCompanyId());
1116                    sb.append(", userId=");
1117                    sb.append(getUserId());
1118                    sb.append(", userName=");
1119                    sb.append(getUserName());
1120                    sb.append(", createDate=");
1121                    sb.append(getCreateDate());
1122                    sb.append(", modifiedDate=");
1123                    sb.append(getModifiedDate());
1124                    sb.append(", title=");
1125                    sb.append(getTitle());
1126                    sb.append(", urlTitle=");
1127                    sb.append(getUrlTitle());
1128                    sb.append(", description=");
1129                    sb.append(getDescription());
1130                    sb.append(", content=");
1131                    sb.append(getContent());
1132                    sb.append(", displayDate=");
1133                    sb.append(getDisplayDate());
1134                    sb.append(", allowPingbacks=");
1135                    sb.append(getAllowPingbacks());
1136                    sb.append(", allowTrackbacks=");
1137                    sb.append(getAllowTrackbacks());
1138                    sb.append(", trackbacks=");
1139                    sb.append(getTrackbacks());
1140                    sb.append(", smallImage=");
1141                    sb.append(getSmallImage());
1142                    sb.append(", smallImageId=");
1143                    sb.append(getSmallImageId());
1144                    sb.append(", smallImageURL=");
1145                    sb.append(getSmallImageURL());
1146                    sb.append(", status=");
1147                    sb.append(getStatus());
1148                    sb.append(", statusByUserId=");
1149                    sb.append(getStatusByUserId());
1150                    sb.append(", statusByUserName=");
1151                    sb.append(getStatusByUserName());
1152                    sb.append(", statusDate=");
1153                    sb.append(getStatusDate());
1154                    sb.append("}");
1155    
1156                    return sb.toString();
1157            }
1158    
1159            public String toXmlString() {
1160                    StringBundler sb = new StringBundler(73);
1161    
1162                    sb.append("<model><model-name>");
1163                    sb.append("com.liferay.portlet.blogs.model.BlogsEntry");
1164                    sb.append("</model-name>");
1165    
1166                    sb.append(
1167                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1168                    sb.append(getUuid());
1169                    sb.append("]]></column-value></column>");
1170                    sb.append(
1171                            "<column><column-name>entryId</column-name><column-value><![CDATA[");
1172                    sb.append(getEntryId());
1173                    sb.append("]]></column-value></column>");
1174                    sb.append(
1175                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1176                    sb.append(getGroupId());
1177                    sb.append("]]></column-value></column>");
1178                    sb.append(
1179                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1180                    sb.append(getCompanyId());
1181                    sb.append("]]></column-value></column>");
1182                    sb.append(
1183                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1184                    sb.append(getUserId());
1185                    sb.append("]]></column-value></column>");
1186                    sb.append(
1187                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1188                    sb.append(getUserName());
1189                    sb.append("]]></column-value></column>");
1190                    sb.append(
1191                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1192                    sb.append(getCreateDate());
1193                    sb.append("]]></column-value></column>");
1194                    sb.append(
1195                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1196                    sb.append(getModifiedDate());
1197                    sb.append("]]></column-value></column>");
1198                    sb.append(
1199                            "<column><column-name>title</column-name><column-value><![CDATA[");
1200                    sb.append(getTitle());
1201                    sb.append("]]></column-value></column>");
1202                    sb.append(
1203                            "<column><column-name>urlTitle</column-name><column-value><![CDATA[");
1204                    sb.append(getUrlTitle());
1205                    sb.append("]]></column-value></column>");
1206                    sb.append(
1207                            "<column><column-name>description</column-name><column-value><![CDATA[");
1208                    sb.append(getDescription());
1209                    sb.append("]]></column-value></column>");
1210                    sb.append(
1211                            "<column><column-name>content</column-name><column-value><![CDATA[");
1212                    sb.append(getContent());
1213                    sb.append("]]></column-value></column>");
1214                    sb.append(
1215                            "<column><column-name>displayDate</column-name><column-value><![CDATA[");
1216                    sb.append(getDisplayDate());
1217                    sb.append("]]></column-value></column>");
1218                    sb.append(
1219                            "<column><column-name>allowPingbacks</column-name><column-value><![CDATA[");
1220                    sb.append(getAllowPingbacks());
1221                    sb.append("]]></column-value></column>");
1222                    sb.append(
1223                            "<column><column-name>allowTrackbacks</column-name><column-value><![CDATA[");
1224                    sb.append(getAllowTrackbacks());
1225                    sb.append("]]></column-value></column>");
1226                    sb.append(
1227                            "<column><column-name>trackbacks</column-name><column-value><![CDATA[");
1228                    sb.append(getTrackbacks());
1229                    sb.append("]]></column-value></column>");
1230                    sb.append(
1231                            "<column><column-name>smallImage</column-name><column-value><![CDATA[");
1232                    sb.append(getSmallImage());
1233                    sb.append("]]></column-value></column>");
1234                    sb.append(
1235                            "<column><column-name>smallImageId</column-name><column-value><![CDATA[");
1236                    sb.append(getSmallImageId());
1237                    sb.append("]]></column-value></column>");
1238                    sb.append(
1239                            "<column><column-name>smallImageURL</column-name><column-value><![CDATA[");
1240                    sb.append(getSmallImageURL());
1241                    sb.append("]]></column-value></column>");
1242                    sb.append(
1243                            "<column><column-name>status</column-name><column-value><![CDATA[");
1244                    sb.append(getStatus());
1245                    sb.append("]]></column-value></column>");
1246                    sb.append(
1247                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1248                    sb.append(getStatusByUserId());
1249                    sb.append("]]></column-value></column>");
1250                    sb.append(
1251                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1252                    sb.append(getStatusByUserName());
1253                    sb.append("]]></column-value></column>");
1254                    sb.append(
1255                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1256                    sb.append(getStatusDate());
1257                    sb.append("]]></column-value></column>");
1258    
1259                    sb.append("</model>");
1260    
1261                    return sb.toString();
1262            }
1263    
1264            private static ClassLoader _classLoader = BlogsEntry.class.getClassLoader();
1265            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
1266                            BlogsEntry.class
1267                    };
1268            private String _uuid;
1269            private String _originalUuid;
1270            private long _entryId;
1271            private long _groupId;
1272            private long _originalGroupId;
1273            private boolean _setOriginalGroupId;
1274            private long _companyId;
1275            private long _originalCompanyId;
1276            private boolean _setOriginalCompanyId;
1277            private long _userId;
1278            private String _userUuid;
1279            private long _originalUserId;
1280            private boolean _setOriginalUserId;
1281            private String _userName;
1282            private Date _createDate;
1283            private Date _modifiedDate;
1284            private String _title;
1285            private String _urlTitle;
1286            private String _originalUrlTitle;
1287            private String _description;
1288            private String _content;
1289            private Date _displayDate;
1290            private Date _originalDisplayDate;
1291            private boolean _allowPingbacks;
1292            private boolean _allowTrackbacks;
1293            private String _trackbacks;
1294            private boolean _smallImage;
1295            private long _smallImageId;
1296            private String _smallImageURL;
1297            private int _status;
1298            private int _originalStatus;
1299            private boolean _setOriginalStatus;
1300            private long _statusByUserId;
1301            private String _statusByUserUuid;
1302            private String _statusByUserName;
1303            private Date _statusDate;
1304            private long _columnBitmask;
1305            private BlogsEntry _escapedModelProxy;
1306    }