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            public static long CREATEDATE_COLUMN_BITMASK = 128L;
118    
119            /**
120             * Converts the soap model instance into a normal model instance.
121             *
122             * @param soapModel the soap model instance to convert
123             * @return the normal model instance
124             */
125            public static BlogsEntry toModel(BlogsEntrySoap soapModel) {
126                    if (soapModel == null) {
127                            return null;
128                    }
129    
130                    BlogsEntry model = new BlogsEntryImpl();
131    
132                    model.setUuid(soapModel.getUuid());
133                    model.setEntryId(soapModel.getEntryId());
134                    model.setGroupId(soapModel.getGroupId());
135                    model.setCompanyId(soapModel.getCompanyId());
136                    model.setUserId(soapModel.getUserId());
137                    model.setUserName(soapModel.getUserName());
138                    model.setCreateDate(soapModel.getCreateDate());
139                    model.setModifiedDate(soapModel.getModifiedDate());
140                    model.setTitle(soapModel.getTitle());
141                    model.setUrlTitle(soapModel.getUrlTitle());
142                    model.setDescription(soapModel.getDescription());
143                    model.setContent(soapModel.getContent());
144                    model.setDisplayDate(soapModel.getDisplayDate());
145                    model.setAllowPingbacks(soapModel.getAllowPingbacks());
146                    model.setAllowTrackbacks(soapModel.getAllowTrackbacks());
147                    model.setTrackbacks(soapModel.getTrackbacks());
148                    model.setSmallImage(soapModel.getSmallImage());
149                    model.setSmallImageId(soapModel.getSmallImageId());
150                    model.setSmallImageURL(soapModel.getSmallImageURL());
151                    model.setStatus(soapModel.getStatus());
152                    model.setStatusByUserId(soapModel.getStatusByUserId());
153                    model.setStatusByUserName(soapModel.getStatusByUserName());
154                    model.setStatusDate(soapModel.getStatusDate());
155    
156                    return model;
157            }
158    
159            /**
160             * Converts the soap model instances into normal model instances.
161             *
162             * @param soapModels the soap model instances to convert
163             * @return the normal model instances
164             */
165            public static List<BlogsEntry> toModels(BlogsEntrySoap[] soapModels) {
166                    if (soapModels == null) {
167                            return null;
168                    }
169    
170                    List<BlogsEntry> models = new ArrayList<BlogsEntry>(soapModels.length);
171    
172                    for (BlogsEntrySoap soapModel : soapModels) {
173                            models.add(toModel(soapModel));
174                    }
175    
176                    return models;
177            }
178    
179            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
180                                    "lock.expiration.time.com.liferay.portlet.blogs.model.BlogsEntry"));
181    
182            public BlogsEntryModelImpl() {
183            }
184    
185            public long getPrimaryKey() {
186                    return _entryId;
187            }
188    
189            public void setPrimaryKey(long primaryKey) {
190                    setEntryId(primaryKey);
191            }
192    
193            public Serializable getPrimaryKeyObj() {
194                    return new Long(_entryId);
195            }
196    
197            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
198                    setPrimaryKey(((Long)primaryKeyObj).longValue());
199            }
200    
201            public Class<?> getModelClass() {
202                    return BlogsEntry.class;
203            }
204    
205            public String getModelClassName() {
206                    return BlogsEntry.class.getName();
207            }
208    
209            @Override
210            public Map<String, Object> getModelAttributes() {
211                    Map<String, Object> attributes = new HashMap<String, Object>();
212    
213                    attributes.put("uuid", getUuid());
214                    attributes.put("entryId", getEntryId());
215                    attributes.put("groupId", getGroupId());
216                    attributes.put("companyId", getCompanyId());
217                    attributes.put("userId", getUserId());
218                    attributes.put("userName", getUserName());
219                    attributes.put("createDate", getCreateDate());
220                    attributes.put("modifiedDate", getModifiedDate());
221                    attributes.put("title", getTitle());
222                    attributes.put("urlTitle", getUrlTitle());
223                    attributes.put("description", getDescription());
224                    attributes.put("content", getContent());
225                    attributes.put("displayDate", getDisplayDate());
226                    attributes.put("allowPingbacks", getAllowPingbacks());
227                    attributes.put("allowTrackbacks", getAllowTrackbacks());
228                    attributes.put("trackbacks", getTrackbacks());
229                    attributes.put("smallImage", getSmallImage());
230                    attributes.put("smallImageId", getSmallImageId());
231                    attributes.put("smallImageURL", getSmallImageURL());
232                    attributes.put("status", getStatus());
233                    attributes.put("statusByUserId", getStatusByUserId());
234                    attributes.put("statusByUserName", getStatusByUserName());
235                    attributes.put("statusDate", getStatusDate());
236    
237                    return attributes;
238            }
239    
240            @Override
241            public void setModelAttributes(Map<String, Object> attributes) {
242                    String uuid = (String)attributes.get("uuid");
243    
244                    if (uuid != null) {
245                            setUuid(uuid);
246                    }
247    
248                    Long entryId = (Long)attributes.get("entryId");
249    
250                    if (entryId != null) {
251                            setEntryId(entryId);
252                    }
253    
254                    Long groupId = (Long)attributes.get("groupId");
255    
256                    if (groupId != null) {
257                            setGroupId(groupId);
258                    }
259    
260                    Long companyId = (Long)attributes.get("companyId");
261    
262                    if (companyId != null) {
263                            setCompanyId(companyId);
264                    }
265    
266                    Long userId = (Long)attributes.get("userId");
267    
268                    if (userId != null) {
269                            setUserId(userId);
270                    }
271    
272                    String userName = (String)attributes.get("userName");
273    
274                    if (userName != null) {
275                            setUserName(userName);
276                    }
277    
278                    Date createDate = (Date)attributes.get("createDate");
279    
280                    if (createDate != null) {
281                            setCreateDate(createDate);
282                    }
283    
284                    Date modifiedDate = (Date)attributes.get("modifiedDate");
285    
286                    if (modifiedDate != null) {
287                            setModifiedDate(modifiedDate);
288                    }
289    
290                    String title = (String)attributes.get("title");
291    
292                    if (title != null) {
293                            setTitle(title);
294                    }
295    
296                    String urlTitle = (String)attributes.get("urlTitle");
297    
298                    if (urlTitle != null) {
299                            setUrlTitle(urlTitle);
300                    }
301    
302                    String description = (String)attributes.get("description");
303    
304                    if (description != null) {
305                            setDescription(description);
306                    }
307    
308                    String content = (String)attributes.get("content");
309    
310                    if (content != null) {
311                            setContent(content);
312                    }
313    
314                    Date displayDate = (Date)attributes.get("displayDate");
315    
316                    if (displayDate != null) {
317                            setDisplayDate(displayDate);
318                    }
319    
320                    Boolean allowPingbacks = (Boolean)attributes.get("allowPingbacks");
321    
322                    if (allowPingbacks != null) {
323                            setAllowPingbacks(allowPingbacks);
324                    }
325    
326                    Boolean allowTrackbacks = (Boolean)attributes.get("allowTrackbacks");
327    
328                    if (allowTrackbacks != null) {
329                            setAllowTrackbacks(allowTrackbacks);
330                    }
331    
332                    String trackbacks = (String)attributes.get("trackbacks");
333    
334                    if (trackbacks != null) {
335                            setTrackbacks(trackbacks);
336                    }
337    
338                    Boolean smallImage = (Boolean)attributes.get("smallImage");
339    
340                    if (smallImage != null) {
341                            setSmallImage(smallImage);
342                    }
343    
344                    Long smallImageId = (Long)attributes.get("smallImageId");
345    
346                    if (smallImageId != null) {
347                            setSmallImageId(smallImageId);
348                    }
349    
350                    String smallImageURL = (String)attributes.get("smallImageURL");
351    
352                    if (smallImageURL != null) {
353                            setSmallImageURL(smallImageURL);
354                    }
355    
356                    Integer status = (Integer)attributes.get("status");
357    
358                    if (status != null) {
359                            setStatus(status);
360                    }
361    
362                    Long statusByUserId = (Long)attributes.get("statusByUserId");
363    
364                    if (statusByUserId != null) {
365                            setStatusByUserId(statusByUserId);
366                    }
367    
368                    String statusByUserName = (String)attributes.get("statusByUserName");
369    
370                    if (statusByUserName != null) {
371                            setStatusByUserName(statusByUserName);
372                    }
373    
374                    Date statusDate = (Date)attributes.get("statusDate");
375    
376                    if (statusDate != null) {
377                            setStatusDate(statusDate);
378                    }
379            }
380    
381            @JSON
382            public String getUuid() {
383                    if (_uuid == null) {
384                            return StringPool.BLANK;
385                    }
386                    else {
387                            return _uuid;
388                    }
389            }
390    
391            public void setUuid(String uuid) {
392                    if (_originalUuid == null) {
393                            _originalUuid = _uuid;
394                    }
395    
396                    _uuid = uuid;
397            }
398    
399            public String getOriginalUuid() {
400                    return GetterUtil.getString(_originalUuid);
401            }
402    
403            @JSON
404            public long getEntryId() {
405                    return _entryId;
406            }
407    
408            public void setEntryId(long entryId) {
409                    _entryId = entryId;
410            }
411    
412            @JSON
413            public long getGroupId() {
414                    return _groupId;
415            }
416    
417            public void setGroupId(long groupId) {
418                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
419    
420                    if (!_setOriginalGroupId) {
421                            _setOriginalGroupId = true;
422    
423                            _originalGroupId = _groupId;
424                    }
425    
426                    _groupId = groupId;
427            }
428    
429            public long getOriginalGroupId() {
430                    return _originalGroupId;
431            }
432    
433            @JSON
434            public long getCompanyId() {
435                    return _companyId;
436            }
437    
438            public void setCompanyId(long companyId) {
439                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
440    
441                    if (!_setOriginalCompanyId) {
442                            _setOriginalCompanyId = true;
443    
444                            _originalCompanyId = _companyId;
445                    }
446    
447                    _companyId = companyId;
448            }
449    
450            public long getOriginalCompanyId() {
451                    return _originalCompanyId;
452            }
453    
454            @JSON
455            public long getUserId() {
456                    return _userId;
457            }
458    
459            public void setUserId(long userId) {
460                    _columnBitmask |= USERID_COLUMN_BITMASK;
461    
462                    if (!_setOriginalUserId) {
463                            _setOriginalUserId = true;
464    
465                            _originalUserId = _userId;
466                    }
467    
468                    _userId = userId;
469            }
470    
471            public String getUserUuid() throws SystemException {
472                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
473            }
474    
475            public void setUserUuid(String userUuid) {
476                    _userUuid = userUuid;
477            }
478    
479            public long getOriginalUserId() {
480                    return _originalUserId;
481            }
482    
483            @JSON
484            public String getUserName() {
485                    if (_userName == null) {
486                            return StringPool.BLANK;
487                    }
488                    else {
489                            return _userName;
490                    }
491            }
492    
493            public void setUserName(String userName) {
494                    _userName = userName;
495            }
496    
497            @JSON
498            public Date getCreateDate() {
499                    return _createDate;
500            }
501    
502            public void setCreateDate(Date createDate) {
503                    _columnBitmask = -1L;
504    
505                    _createDate = createDate;
506            }
507    
508            @JSON
509            public Date getModifiedDate() {
510                    return _modifiedDate;
511            }
512    
513            public void setModifiedDate(Date modifiedDate) {
514                    _modifiedDate = modifiedDate;
515            }
516    
517            @JSON
518            public String getTitle() {
519                    if (_title == null) {
520                            return StringPool.BLANK;
521                    }
522                    else {
523                            return _title;
524                    }
525            }
526    
527            public void setTitle(String title) {
528                    _title = title;
529            }
530    
531            @JSON
532            public String getUrlTitle() {
533                    if (_urlTitle == null) {
534                            return StringPool.BLANK;
535                    }
536                    else {
537                            return _urlTitle;
538                    }
539            }
540    
541            public void setUrlTitle(String urlTitle) {
542                    _columnBitmask |= URLTITLE_COLUMN_BITMASK;
543    
544                    if (_originalUrlTitle == null) {
545                            _originalUrlTitle = _urlTitle;
546                    }
547    
548                    _urlTitle = urlTitle;
549            }
550    
551            public String getOriginalUrlTitle() {
552                    return GetterUtil.getString(_originalUrlTitle);
553            }
554    
555            @JSON
556            public String getDescription() {
557                    if (_description == null) {
558                            return StringPool.BLANK;
559                    }
560                    else {
561                            return _description;
562                    }
563            }
564    
565            public void setDescription(String description) {
566                    _description = description;
567            }
568    
569            @JSON
570            public String getContent() {
571                    if (_content == null) {
572                            return StringPool.BLANK;
573                    }
574                    else {
575                            return _content;
576                    }
577            }
578    
579            public void setContent(String content) {
580                    _content = content;
581            }
582    
583            @JSON
584            public Date getDisplayDate() {
585                    return _displayDate;
586            }
587    
588            public void setDisplayDate(Date displayDate) {
589                    _columnBitmask = -1L;
590    
591                    if (_originalDisplayDate == null) {
592                            _originalDisplayDate = _displayDate;
593                    }
594    
595                    _displayDate = displayDate;
596            }
597    
598            public Date getOriginalDisplayDate() {
599                    return _originalDisplayDate;
600            }
601    
602            @JSON
603            public boolean getAllowPingbacks() {
604                    return _allowPingbacks;
605            }
606    
607            public boolean isAllowPingbacks() {
608                    return _allowPingbacks;
609            }
610    
611            public void setAllowPingbacks(boolean allowPingbacks) {
612                    _allowPingbacks = allowPingbacks;
613            }
614    
615            @JSON
616            public boolean getAllowTrackbacks() {
617                    return _allowTrackbacks;
618            }
619    
620            public boolean isAllowTrackbacks() {
621                    return _allowTrackbacks;
622            }
623    
624            public void setAllowTrackbacks(boolean allowTrackbacks) {
625                    _allowTrackbacks = allowTrackbacks;
626            }
627    
628            @JSON
629            public String getTrackbacks() {
630                    if (_trackbacks == null) {
631                            return StringPool.BLANK;
632                    }
633                    else {
634                            return _trackbacks;
635                    }
636            }
637    
638            public void setTrackbacks(String trackbacks) {
639                    _trackbacks = trackbacks;
640            }
641    
642            @JSON
643            public boolean getSmallImage() {
644                    return _smallImage;
645            }
646    
647            public boolean isSmallImage() {
648                    return _smallImage;
649            }
650    
651            public void setSmallImage(boolean smallImage) {
652                    _smallImage = smallImage;
653            }
654    
655            @JSON
656            public long getSmallImageId() {
657                    return _smallImageId;
658            }
659    
660            public void setSmallImageId(long smallImageId) {
661                    _smallImageId = smallImageId;
662            }
663    
664            @JSON
665            public String getSmallImageURL() {
666                    if (_smallImageURL == null) {
667                            return StringPool.BLANK;
668                    }
669                    else {
670                            return _smallImageURL;
671                    }
672            }
673    
674            public void setSmallImageURL(String smallImageURL) {
675                    _smallImageURL = smallImageURL;
676            }
677    
678            @JSON
679            public int getStatus() {
680                    return _status;
681            }
682    
683            public void setStatus(int status) {
684                    _columnBitmask |= STATUS_COLUMN_BITMASK;
685    
686                    if (!_setOriginalStatus) {
687                            _setOriginalStatus = true;
688    
689                            _originalStatus = _status;
690                    }
691    
692                    _status = status;
693            }
694    
695            public int getOriginalStatus() {
696                    return _originalStatus;
697            }
698    
699            @JSON
700            public long getStatusByUserId() {
701                    return _statusByUserId;
702            }
703    
704            public void setStatusByUserId(long statusByUserId) {
705                    _statusByUserId = statusByUserId;
706            }
707    
708            public String getStatusByUserUuid() throws SystemException {
709                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
710                            _statusByUserUuid);
711            }
712    
713            public void setStatusByUserUuid(String statusByUserUuid) {
714                    _statusByUserUuid = statusByUserUuid;
715            }
716    
717            @JSON
718            public String getStatusByUserName() {
719                    if (_statusByUserName == null) {
720                            return StringPool.BLANK;
721                    }
722                    else {
723                            return _statusByUserName;
724                    }
725            }
726    
727            public void setStatusByUserName(String statusByUserName) {
728                    _statusByUserName = statusByUserName;
729            }
730    
731            @JSON
732            public Date getStatusDate() {
733                    return _statusDate;
734            }
735    
736            public void setStatusDate(Date statusDate) {
737                    _statusDate = statusDate;
738            }
739    
740            /**
741             * @deprecated {@link #isApproved}
742             */
743            public boolean getApproved() {
744                    return isApproved();
745            }
746    
747            public boolean isApproved() {
748                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
749                            return true;
750                    }
751                    else {
752                            return false;
753                    }
754            }
755    
756            public boolean isDenied() {
757                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
758                            return true;
759                    }
760                    else {
761                            return false;
762                    }
763            }
764    
765            public boolean isDraft() {
766                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
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 isInTrash() {
802                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
803                            return true;
804                    }
805                    else {
806                            return false;
807                    }
808            }
809    
810            public boolean isPending() {
811                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
812                            return true;
813                    }
814                    else {
815                            return false;
816                    }
817            }
818    
819            public boolean isScheduled() {
820                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
821                            return true;
822                    }
823                    else {
824                            return false;
825                    }
826            }
827    
828            public long getColumnBitmask() {
829                    return _columnBitmask;
830            }
831    
832            @Override
833            public ExpandoBridge getExpandoBridge() {
834                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
835                            BlogsEntry.class.getName(), getPrimaryKey());
836            }
837    
838            @Override
839            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
840                    ExpandoBridge expandoBridge = getExpandoBridge();
841    
842                    expandoBridge.setAttributes(serviceContext);
843            }
844    
845            @Override
846            public BlogsEntry toEscapedModel() {
847                    if (_escapedModel == null) {
848                            _escapedModel = (BlogsEntry)ProxyUtil.newProxyInstance(_classLoader,
849                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
850                    }
851    
852                    return _escapedModel;
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<?>[] _escapedModelInterfaces = 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 _escapedModel;
1306    }