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