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