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