001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.kernel.workflow.WorkflowConstants;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.impl.BaseModelImpl;
027    import com.liferay.portal.service.ServiceContext;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.expando.model.ExpandoBridge;
031    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
032    import com.liferay.portlet.journal.model.JournalFolder;
033    import com.liferay.portlet.journal.model.JournalFolderModel;
034    import com.liferay.portlet.journal.model.JournalFolderSoap;
035    
036    import java.io.Serializable;
037    
038    import java.sql.Types;
039    
040    import java.util.ArrayList;
041    import java.util.Date;
042    import java.util.HashMap;
043    import java.util.List;
044    import java.util.Map;
045    
046    /**
047     * The base model implementation for the JournalFolder service. Represents a row in the "JournalFolder" database table, with each column mapped to a property of this class.
048     *
049     * <p>
050     * This implementation and its corresponding interface {@link com.liferay.portlet.journal.model.JournalFolderModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link JournalFolderImpl}.
051     * </p>
052     *
053     * @author Brian Wing Shun Chan
054     * @see JournalFolderImpl
055     * @see com.liferay.portlet.journal.model.JournalFolder
056     * @see com.liferay.portlet.journal.model.JournalFolderModel
057     * @generated
058     */
059    @JSON(strict = true)
060    public class JournalFolderModelImpl extends BaseModelImpl<JournalFolder>
061            implements JournalFolderModel {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. All methods that expect a journal folder model instance should use the {@link com.liferay.portlet.journal.model.JournalFolder} interface instead.
066             */
067            public static final String TABLE_NAME = "JournalFolder";
068            public static final Object[][] TABLE_COLUMNS = {
069                            { "uuid_", Types.VARCHAR },
070                            { "folderId", Types.BIGINT },
071                            { "groupId", Types.BIGINT },
072                            { "companyId", Types.BIGINT },
073                            { "userId", Types.BIGINT },
074                            { "userName", Types.VARCHAR },
075                            { "createDate", Types.TIMESTAMP },
076                            { "modifiedDate", Types.TIMESTAMP },
077                            { "parentFolderId", Types.BIGINT },
078                            { "name", Types.VARCHAR },
079                            { "description", Types.VARCHAR },
080                            { "status", Types.INTEGER },
081                            { "statusByUserId", Types.BIGINT },
082                            { "statusByUserName", Types.VARCHAR },
083                            { "statusDate", Types.TIMESTAMP }
084                    };
085            public static final String TABLE_SQL_CREATE = "create table JournalFolder (uuid_ VARCHAR(75) null,folderId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,parentFolderId LONG,name VARCHAR(100) null,description STRING null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
086            public static final String TABLE_SQL_DROP = "drop table JournalFolder";
087            public static final String ORDER_BY_JPQL = " ORDER BY journalFolder.parentFolderId ASC, journalFolder.name ASC";
088            public static final String ORDER_BY_SQL = " ORDER BY JournalFolder.parentFolderId ASC, JournalFolder.name ASC";
089            public static final String DATA_SOURCE = "liferayDataSource";
090            public static final String SESSION_FACTORY = "liferaySessionFactory";
091            public static final String TX_MANAGER = "liferayTransactionManager";
092            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
093                                    "value.object.entity.cache.enabled.com.liferay.portlet.journal.model.JournalFolder"),
094                            true);
095            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
096                                    "value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalFolder"),
097                            true);
098            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
099                                    "value.object.column.bitmask.enabled.com.liferay.portlet.journal.model.JournalFolder"),
100                            true);
101            public static long COMPANYID_COLUMN_BITMASK = 1L;
102            public static long GROUPID_COLUMN_BITMASK = 2L;
103            public static long NAME_COLUMN_BITMASK = 4L;
104            public static long PARENTFOLDERID_COLUMN_BITMASK = 8L;
105            public static long STATUS_COLUMN_BITMASK = 16L;
106            public static long UUID_COLUMN_BITMASK = 32L;
107    
108            /**
109             * Converts the soap model instance into a normal model instance.
110             *
111             * @param soapModel the soap model instance to convert
112             * @return the normal model instance
113             */
114            public static JournalFolder toModel(JournalFolderSoap soapModel) {
115                    if (soapModel == null) {
116                            return null;
117                    }
118    
119                    JournalFolder model = new JournalFolderImpl();
120    
121                    model.setUuid(soapModel.getUuid());
122                    model.setFolderId(soapModel.getFolderId());
123                    model.setGroupId(soapModel.getGroupId());
124                    model.setCompanyId(soapModel.getCompanyId());
125                    model.setUserId(soapModel.getUserId());
126                    model.setUserName(soapModel.getUserName());
127                    model.setCreateDate(soapModel.getCreateDate());
128                    model.setModifiedDate(soapModel.getModifiedDate());
129                    model.setParentFolderId(soapModel.getParentFolderId());
130                    model.setName(soapModel.getName());
131                    model.setDescription(soapModel.getDescription());
132                    model.setStatus(soapModel.getStatus());
133                    model.setStatusByUserId(soapModel.getStatusByUserId());
134                    model.setStatusByUserName(soapModel.getStatusByUserName());
135                    model.setStatusDate(soapModel.getStatusDate());
136    
137                    return model;
138            }
139    
140            /**
141             * Converts the soap model instances into normal model instances.
142             *
143             * @param soapModels the soap model instances to convert
144             * @return the normal model instances
145             */
146            public static List<JournalFolder> toModels(JournalFolderSoap[] soapModels) {
147                    if (soapModels == null) {
148                            return null;
149                    }
150    
151                    List<JournalFolder> models = new ArrayList<JournalFolder>(soapModels.length);
152    
153                    for (JournalFolderSoap soapModel : soapModels) {
154                            models.add(toModel(soapModel));
155                    }
156    
157                    return models;
158            }
159    
160            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
161                                    "lock.expiration.time.com.liferay.portlet.journal.model.JournalFolder"));
162    
163            public JournalFolderModelImpl() {
164            }
165    
166            public long getPrimaryKey() {
167                    return _folderId;
168            }
169    
170            public void setPrimaryKey(long primaryKey) {
171                    setFolderId(primaryKey);
172            }
173    
174            public Serializable getPrimaryKeyObj() {
175                    return _folderId;
176            }
177    
178            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
179                    setPrimaryKey(((Long)primaryKeyObj).longValue());
180            }
181    
182            public Class<?> getModelClass() {
183                    return JournalFolder.class;
184            }
185    
186            public String getModelClassName() {
187                    return JournalFolder.class.getName();
188            }
189    
190            @Override
191            public Map<String, Object> getModelAttributes() {
192                    Map<String, Object> attributes = new HashMap<String, Object>();
193    
194                    attributes.put("uuid", getUuid());
195                    attributes.put("folderId", getFolderId());
196                    attributes.put("groupId", getGroupId());
197                    attributes.put("companyId", getCompanyId());
198                    attributes.put("userId", getUserId());
199                    attributes.put("userName", getUserName());
200                    attributes.put("createDate", getCreateDate());
201                    attributes.put("modifiedDate", getModifiedDate());
202                    attributes.put("parentFolderId", getParentFolderId());
203                    attributes.put("name", getName());
204                    attributes.put("description", getDescription());
205                    attributes.put("status", getStatus());
206                    attributes.put("statusByUserId", getStatusByUserId());
207                    attributes.put("statusByUserName", getStatusByUserName());
208                    attributes.put("statusDate", getStatusDate());
209    
210                    return attributes;
211            }
212    
213            @Override
214            public void setModelAttributes(Map<String, Object> attributes) {
215                    String uuid = (String)attributes.get("uuid");
216    
217                    if (uuid != null) {
218                            setUuid(uuid);
219                    }
220    
221                    Long folderId = (Long)attributes.get("folderId");
222    
223                    if (folderId != null) {
224                            setFolderId(folderId);
225                    }
226    
227                    Long groupId = (Long)attributes.get("groupId");
228    
229                    if (groupId != null) {
230                            setGroupId(groupId);
231                    }
232    
233                    Long companyId = (Long)attributes.get("companyId");
234    
235                    if (companyId != null) {
236                            setCompanyId(companyId);
237                    }
238    
239                    Long userId = (Long)attributes.get("userId");
240    
241                    if (userId != null) {
242                            setUserId(userId);
243                    }
244    
245                    String userName = (String)attributes.get("userName");
246    
247                    if (userName != null) {
248                            setUserName(userName);
249                    }
250    
251                    Date createDate = (Date)attributes.get("createDate");
252    
253                    if (createDate != null) {
254                            setCreateDate(createDate);
255                    }
256    
257                    Date modifiedDate = (Date)attributes.get("modifiedDate");
258    
259                    if (modifiedDate != null) {
260                            setModifiedDate(modifiedDate);
261                    }
262    
263                    Long parentFolderId = (Long)attributes.get("parentFolderId");
264    
265                    if (parentFolderId != null) {
266                            setParentFolderId(parentFolderId);
267                    }
268    
269                    String name = (String)attributes.get("name");
270    
271                    if (name != null) {
272                            setName(name);
273                    }
274    
275                    String description = (String)attributes.get("description");
276    
277                    if (description != null) {
278                            setDescription(description);
279                    }
280    
281                    Integer status = (Integer)attributes.get("status");
282    
283                    if (status != null) {
284                            setStatus(status);
285                    }
286    
287                    Long statusByUserId = (Long)attributes.get("statusByUserId");
288    
289                    if (statusByUserId != null) {
290                            setStatusByUserId(statusByUserId);
291                    }
292    
293                    String statusByUserName = (String)attributes.get("statusByUserName");
294    
295                    if (statusByUserName != null) {
296                            setStatusByUserName(statusByUserName);
297                    }
298    
299                    Date statusDate = (Date)attributes.get("statusDate");
300    
301                    if (statusDate != null) {
302                            setStatusDate(statusDate);
303                    }
304            }
305    
306            @JSON
307            public String getUuid() {
308                    if (_uuid == null) {
309                            return StringPool.BLANK;
310                    }
311                    else {
312                            return _uuid;
313                    }
314            }
315    
316            public void setUuid(String uuid) {
317                    if (_originalUuid == null) {
318                            _originalUuid = _uuid;
319                    }
320    
321                    _uuid = uuid;
322            }
323    
324            public String getOriginalUuid() {
325                    return GetterUtil.getString(_originalUuid);
326            }
327    
328            @JSON
329            public long getFolderId() {
330                    return _folderId;
331            }
332    
333            public void setFolderId(long folderId) {
334                    _folderId = folderId;
335            }
336    
337            @JSON
338            public long getGroupId() {
339                    return _groupId;
340            }
341    
342            public void setGroupId(long groupId) {
343                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
344    
345                    if (!_setOriginalGroupId) {
346                            _setOriginalGroupId = true;
347    
348                            _originalGroupId = _groupId;
349                    }
350    
351                    _groupId = groupId;
352            }
353    
354            public long getOriginalGroupId() {
355                    return _originalGroupId;
356            }
357    
358            @JSON
359            public long getCompanyId() {
360                    return _companyId;
361            }
362    
363            public void setCompanyId(long companyId) {
364                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
365    
366                    if (!_setOriginalCompanyId) {
367                            _setOriginalCompanyId = true;
368    
369                            _originalCompanyId = _companyId;
370                    }
371    
372                    _companyId = companyId;
373            }
374    
375            public long getOriginalCompanyId() {
376                    return _originalCompanyId;
377            }
378    
379            @JSON
380            public long getUserId() {
381                    return _userId;
382            }
383    
384            public void setUserId(long userId) {
385                    _userId = userId;
386            }
387    
388            public String getUserUuid() throws SystemException {
389                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
390            }
391    
392            public void setUserUuid(String userUuid) {
393                    _userUuid = userUuid;
394            }
395    
396            @JSON
397            public String getUserName() {
398                    if (_userName == null) {
399                            return StringPool.BLANK;
400                    }
401                    else {
402                            return _userName;
403                    }
404            }
405    
406            public void setUserName(String userName) {
407                    _userName = userName;
408            }
409    
410            @JSON
411            public Date getCreateDate() {
412                    return _createDate;
413            }
414    
415            public void setCreateDate(Date createDate) {
416                    _createDate = createDate;
417            }
418    
419            @JSON
420            public Date getModifiedDate() {
421                    return _modifiedDate;
422            }
423    
424            public void setModifiedDate(Date modifiedDate) {
425                    _modifiedDate = modifiedDate;
426            }
427    
428            @JSON
429            public long getParentFolderId() {
430                    return _parentFolderId;
431            }
432    
433            public void setParentFolderId(long parentFolderId) {
434                    _columnBitmask = -1L;
435    
436                    if (!_setOriginalParentFolderId) {
437                            _setOriginalParentFolderId = true;
438    
439                            _originalParentFolderId = _parentFolderId;
440                    }
441    
442                    _parentFolderId = parentFolderId;
443            }
444    
445            public long getOriginalParentFolderId() {
446                    return _originalParentFolderId;
447            }
448    
449            @JSON
450            public String getName() {
451                    if (_name == null) {
452                            return StringPool.BLANK;
453                    }
454                    else {
455                            return _name;
456                    }
457            }
458    
459            public void setName(String name) {
460                    _columnBitmask = -1L;
461    
462                    if (_originalName == null) {
463                            _originalName = _name;
464                    }
465    
466                    _name = name;
467            }
468    
469            public String getOriginalName() {
470                    return GetterUtil.getString(_originalName);
471            }
472    
473            @JSON
474            public String getDescription() {
475                    if (_description == null) {
476                            return StringPool.BLANK;
477                    }
478                    else {
479                            return _description;
480                    }
481            }
482    
483            public void setDescription(String description) {
484                    _description = description;
485            }
486    
487            @JSON
488            public int getStatus() {
489                    return _status;
490            }
491    
492            public void setStatus(int status) {
493                    _columnBitmask |= STATUS_COLUMN_BITMASK;
494    
495                    if (!_setOriginalStatus) {
496                            _setOriginalStatus = true;
497    
498                            _originalStatus = _status;
499                    }
500    
501                    _status = status;
502            }
503    
504            public int getOriginalStatus() {
505                    return _originalStatus;
506            }
507    
508            @JSON
509            public long getStatusByUserId() {
510                    return _statusByUserId;
511            }
512    
513            public void setStatusByUserId(long statusByUserId) {
514                    _statusByUserId = statusByUserId;
515            }
516    
517            public String getStatusByUserUuid() throws SystemException {
518                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
519                            _statusByUserUuid);
520            }
521    
522            public void setStatusByUserUuid(String statusByUserUuid) {
523                    _statusByUserUuid = statusByUserUuid;
524            }
525    
526            @JSON
527            public String getStatusByUserName() {
528                    if (_statusByUserName == null) {
529                            return StringPool.BLANK;
530                    }
531                    else {
532                            return _statusByUserName;
533                    }
534            }
535    
536            public void setStatusByUserName(String statusByUserName) {
537                    _statusByUserName = statusByUserName;
538            }
539    
540            @JSON
541            public Date getStatusDate() {
542                    return _statusDate;
543            }
544    
545            public void setStatusDate(Date statusDate) {
546                    _statusDate = statusDate;
547            }
548    
549            public long getContainerModelId() {
550                    return getFolderId();
551            }
552    
553            public void setContainerModelId(long containerModelId) {
554                    _folderId = containerModelId;
555            }
556    
557            public String getContainerModelName() {
558                    return String.valueOf(getName());
559            }
560    
561            public long getParentContainerModelId() {
562                    return 0;
563            }
564    
565            public void setParentContainerModelId(long parentContainerModelId) {
566            }
567    
568            /**
569             * @deprecated As of 6.1.0, replaced by {@link #isApproved}
570             */
571            public boolean getApproved() {
572                    return isApproved();
573            }
574    
575            public boolean isApproved() {
576                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
577                            return true;
578                    }
579                    else {
580                            return false;
581                    }
582            }
583    
584            public boolean isDenied() {
585                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
586                            return true;
587                    }
588                    else {
589                            return false;
590                    }
591            }
592    
593            public boolean isDraft() {
594                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
595                            return true;
596                    }
597                    else {
598                            return false;
599                    }
600            }
601    
602            public boolean isExpired() {
603                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
604                            return true;
605                    }
606                    else {
607                            return false;
608                    }
609            }
610    
611            public boolean isInactive() {
612                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
613                            return true;
614                    }
615                    else {
616                            return false;
617                    }
618            }
619    
620            public boolean isIncomplete() {
621                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
622                            return true;
623                    }
624                    else {
625                            return false;
626                    }
627            }
628    
629            public boolean isInTrash() {
630                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
631                            return true;
632                    }
633                    else {
634                            return false;
635                    }
636            }
637    
638            public boolean isPending() {
639                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
640                            return true;
641                    }
642                    else {
643                            return false;
644                    }
645            }
646    
647            public boolean isScheduled() {
648                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
649                            return true;
650                    }
651                    else {
652                            return false;
653                    }
654            }
655    
656            public long getColumnBitmask() {
657                    return _columnBitmask;
658            }
659    
660            @Override
661            public ExpandoBridge getExpandoBridge() {
662                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
663                            JournalFolder.class.getName(), getPrimaryKey());
664            }
665    
666            @Override
667            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
668                    ExpandoBridge expandoBridge = getExpandoBridge();
669    
670                    expandoBridge.setAttributes(serviceContext);
671            }
672    
673            @Override
674            public JournalFolder toEscapedModel() {
675                    if (_escapedModel == null) {
676                            _escapedModel = (JournalFolder)ProxyUtil.newProxyInstance(_classLoader,
677                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
678                    }
679    
680                    return _escapedModel;
681            }
682    
683            @Override
684            public Object clone() {
685                    JournalFolderImpl journalFolderImpl = new JournalFolderImpl();
686    
687                    journalFolderImpl.setUuid(getUuid());
688                    journalFolderImpl.setFolderId(getFolderId());
689                    journalFolderImpl.setGroupId(getGroupId());
690                    journalFolderImpl.setCompanyId(getCompanyId());
691                    journalFolderImpl.setUserId(getUserId());
692                    journalFolderImpl.setUserName(getUserName());
693                    journalFolderImpl.setCreateDate(getCreateDate());
694                    journalFolderImpl.setModifiedDate(getModifiedDate());
695                    journalFolderImpl.setParentFolderId(getParentFolderId());
696                    journalFolderImpl.setName(getName());
697                    journalFolderImpl.setDescription(getDescription());
698                    journalFolderImpl.setStatus(getStatus());
699                    journalFolderImpl.setStatusByUserId(getStatusByUserId());
700                    journalFolderImpl.setStatusByUserName(getStatusByUserName());
701                    journalFolderImpl.setStatusDate(getStatusDate());
702    
703                    journalFolderImpl.resetOriginalValues();
704    
705                    return journalFolderImpl;
706            }
707    
708            public int compareTo(JournalFolder journalFolder) {
709                    int value = 0;
710    
711                    if (getParentFolderId() < journalFolder.getParentFolderId()) {
712                            value = -1;
713                    }
714                    else if (getParentFolderId() > journalFolder.getParentFolderId()) {
715                            value = 1;
716                    }
717                    else {
718                            value = 0;
719                    }
720    
721                    if (value != 0) {
722                            return value;
723                    }
724    
725                    value = getName().compareToIgnoreCase(journalFolder.getName());
726    
727                    if (value != 0) {
728                            return value;
729                    }
730    
731                    return 0;
732            }
733    
734            @Override
735            public boolean equals(Object obj) {
736                    if (obj == null) {
737                            return false;
738                    }
739    
740                    JournalFolder journalFolder = null;
741    
742                    try {
743                            journalFolder = (JournalFolder)obj;
744                    }
745                    catch (ClassCastException cce) {
746                            return false;
747                    }
748    
749                    long primaryKey = journalFolder.getPrimaryKey();
750    
751                    if (getPrimaryKey() == primaryKey) {
752                            return true;
753                    }
754                    else {
755                            return false;
756                    }
757            }
758    
759            @Override
760            public int hashCode() {
761                    return (int)getPrimaryKey();
762            }
763    
764            @Override
765            public void resetOriginalValues() {
766                    JournalFolderModelImpl journalFolderModelImpl = this;
767    
768                    journalFolderModelImpl._originalUuid = journalFolderModelImpl._uuid;
769    
770                    journalFolderModelImpl._originalGroupId = journalFolderModelImpl._groupId;
771    
772                    journalFolderModelImpl._setOriginalGroupId = false;
773    
774                    journalFolderModelImpl._originalCompanyId = journalFolderModelImpl._companyId;
775    
776                    journalFolderModelImpl._setOriginalCompanyId = false;
777    
778                    journalFolderModelImpl._originalParentFolderId = journalFolderModelImpl._parentFolderId;
779    
780                    journalFolderModelImpl._setOriginalParentFolderId = false;
781    
782                    journalFolderModelImpl._originalName = journalFolderModelImpl._name;
783    
784                    journalFolderModelImpl._originalStatus = journalFolderModelImpl._status;
785    
786                    journalFolderModelImpl._setOriginalStatus = false;
787    
788                    journalFolderModelImpl._columnBitmask = 0;
789            }
790    
791            @Override
792            public CacheModel<JournalFolder> toCacheModel() {
793                    JournalFolderCacheModel journalFolderCacheModel = new JournalFolderCacheModel();
794    
795                    journalFolderCacheModel.uuid = getUuid();
796    
797                    String uuid = journalFolderCacheModel.uuid;
798    
799                    if ((uuid != null) && (uuid.length() == 0)) {
800                            journalFolderCacheModel.uuid = null;
801                    }
802    
803                    journalFolderCacheModel.folderId = getFolderId();
804    
805                    journalFolderCacheModel.groupId = getGroupId();
806    
807                    journalFolderCacheModel.companyId = getCompanyId();
808    
809                    journalFolderCacheModel.userId = getUserId();
810    
811                    journalFolderCacheModel.userName = getUserName();
812    
813                    String userName = journalFolderCacheModel.userName;
814    
815                    if ((userName != null) && (userName.length() == 0)) {
816                            journalFolderCacheModel.userName = null;
817                    }
818    
819                    Date createDate = getCreateDate();
820    
821                    if (createDate != null) {
822                            journalFolderCacheModel.createDate = createDate.getTime();
823                    }
824                    else {
825                            journalFolderCacheModel.createDate = Long.MIN_VALUE;
826                    }
827    
828                    Date modifiedDate = getModifiedDate();
829    
830                    if (modifiedDate != null) {
831                            journalFolderCacheModel.modifiedDate = modifiedDate.getTime();
832                    }
833                    else {
834                            journalFolderCacheModel.modifiedDate = Long.MIN_VALUE;
835                    }
836    
837                    journalFolderCacheModel.parentFolderId = getParentFolderId();
838    
839                    journalFolderCacheModel.name = getName();
840    
841                    String name = journalFolderCacheModel.name;
842    
843                    if ((name != null) && (name.length() == 0)) {
844                            journalFolderCacheModel.name = null;
845                    }
846    
847                    journalFolderCacheModel.description = getDescription();
848    
849                    String description = journalFolderCacheModel.description;
850    
851                    if ((description != null) && (description.length() == 0)) {
852                            journalFolderCacheModel.description = null;
853                    }
854    
855                    journalFolderCacheModel.status = getStatus();
856    
857                    journalFolderCacheModel.statusByUserId = getStatusByUserId();
858    
859                    journalFolderCacheModel.statusByUserName = getStatusByUserName();
860    
861                    String statusByUserName = journalFolderCacheModel.statusByUserName;
862    
863                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
864                            journalFolderCacheModel.statusByUserName = null;
865                    }
866    
867                    Date statusDate = getStatusDate();
868    
869                    if (statusDate != null) {
870                            journalFolderCacheModel.statusDate = statusDate.getTime();
871                    }
872                    else {
873                            journalFolderCacheModel.statusDate = Long.MIN_VALUE;
874                    }
875    
876                    return journalFolderCacheModel;
877            }
878    
879            @Override
880            public String toString() {
881                    StringBundler sb = new StringBundler(31);
882    
883                    sb.append("{uuid=");
884                    sb.append(getUuid());
885                    sb.append(", folderId=");
886                    sb.append(getFolderId());
887                    sb.append(", groupId=");
888                    sb.append(getGroupId());
889                    sb.append(", companyId=");
890                    sb.append(getCompanyId());
891                    sb.append(", userId=");
892                    sb.append(getUserId());
893                    sb.append(", userName=");
894                    sb.append(getUserName());
895                    sb.append(", createDate=");
896                    sb.append(getCreateDate());
897                    sb.append(", modifiedDate=");
898                    sb.append(getModifiedDate());
899                    sb.append(", parentFolderId=");
900                    sb.append(getParentFolderId());
901                    sb.append(", name=");
902                    sb.append(getName());
903                    sb.append(", description=");
904                    sb.append(getDescription());
905                    sb.append(", status=");
906                    sb.append(getStatus());
907                    sb.append(", statusByUserId=");
908                    sb.append(getStatusByUserId());
909                    sb.append(", statusByUserName=");
910                    sb.append(getStatusByUserName());
911                    sb.append(", statusDate=");
912                    sb.append(getStatusDate());
913                    sb.append("}");
914    
915                    return sb.toString();
916            }
917    
918            public String toXmlString() {
919                    StringBundler sb = new StringBundler(49);
920    
921                    sb.append("<model><model-name>");
922                    sb.append("com.liferay.portlet.journal.model.JournalFolder");
923                    sb.append("</model-name>");
924    
925                    sb.append(
926                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
927                    sb.append(getUuid());
928                    sb.append("]]></column-value></column>");
929                    sb.append(
930                            "<column><column-name>folderId</column-name><column-value><![CDATA[");
931                    sb.append(getFolderId());
932                    sb.append("]]></column-value></column>");
933                    sb.append(
934                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
935                    sb.append(getGroupId());
936                    sb.append("]]></column-value></column>");
937                    sb.append(
938                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
939                    sb.append(getCompanyId());
940                    sb.append("]]></column-value></column>");
941                    sb.append(
942                            "<column><column-name>userId</column-name><column-value><![CDATA[");
943                    sb.append(getUserId());
944                    sb.append("]]></column-value></column>");
945                    sb.append(
946                            "<column><column-name>userName</column-name><column-value><![CDATA[");
947                    sb.append(getUserName());
948                    sb.append("]]></column-value></column>");
949                    sb.append(
950                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
951                    sb.append(getCreateDate());
952                    sb.append("]]></column-value></column>");
953                    sb.append(
954                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
955                    sb.append(getModifiedDate());
956                    sb.append("]]></column-value></column>");
957                    sb.append(
958                            "<column><column-name>parentFolderId</column-name><column-value><![CDATA[");
959                    sb.append(getParentFolderId());
960                    sb.append("]]></column-value></column>");
961                    sb.append(
962                            "<column><column-name>name</column-name><column-value><![CDATA[");
963                    sb.append(getName());
964                    sb.append("]]></column-value></column>");
965                    sb.append(
966                            "<column><column-name>description</column-name><column-value><![CDATA[");
967                    sb.append(getDescription());
968                    sb.append("]]></column-value></column>");
969                    sb.append(
970                            "<column><column-name>status</column-name><column-value><![CDATA[");
971                    sb.append(getStatus());
972                    sb.append("]]></column-value></column>");
973                    sb.append(
974                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
975                    sb.append(getStatusByUserId());
976                    sb.append("]]></column-value></column>");
977                    sb.append(
978                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
979                    sb.append(getStatusByUserName());
980                    sb.append("]]></column-value></column>");
981                    sb.append(
982                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
983                    sb.append(getStatusDate());
984                    sb.append("]]></column-value></column>");
985    
986                    sb.append("</model>");
987    
988                    return sb.toString();
989            }
990    
991            private static ClassLoader _classLoader = JournalFolder.class.getClassLoader();
992            private static Class<?>[] _escapedModelInterfaces = new Class[] {
993                            JournalFolder.class
994                    };
995            private String _uuid;
996            private String _originalUuid;
997            private long _folderId;
998            private long _groupId;
999            private long _originalGroupId;
1000            private boolean _setOriginalGroupId;
1001            private long _companyId;
1002            private long _originalCompanyId;
1003            private boolean _setOriginalCompanyId;
1004            private long _userId;
1005            private String _userUuid;
1006            private String _userName;
1007            private Date _createDate;
1008            private Date _modifiedDate;
1009            private long _parentFolderId;
1010            private long _originalParentFolderId;
1011            private boolean _setOriginalParentFolderId;
1012            private String _name;
1013            private String _originalName;
1014            private String _description;
1015            private int _status;
1016            private int _originalStatus;
1017            private boolean _setOriginalStatus;
1018            private long _statusByUserId;
1019            private String _statusByUserUuid;
1020            private String _statusByUserName;
1021            private Date _statusDate;
1022            private long _columnBitmask;
1023            private JournalFolder _escapedModel;
1024    }