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