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