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