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.DateUtil;
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.DLFileVersion;
032    import com.liferay.portlet.documentlibrary.model.DLFileVersionModel;
033    import com.liferay.portlet.documentlibrary.model.DLFileVersionSoap;
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 DLFileVersion service. Represents a row in the "DLFileVersion" 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.DLFileVersionModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link DLFileVersionImpl}.
052     * </p>
053     *
054     * @author Brian Wing Shun Chan
055     * @see DLFileVersionImpl
056     * @see com.liferay.portlet.documentlibrary.model.DLFileVersion
057     * @see com.liferay.portlet.documentlibrary.model.DLFileVersionModel
058     * @generated
059     */
060    @JSON(strict = true)
061    public class DLFileVersionModelImpl extends BaseModelImpl<DLFileVersion>
062            implements DLFileVersionModel {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this class directly. All methods that expect a document library file version model instance should use the {@link com.liferay.portlet.documentlibrary.model.DLFileVersion} interface instead.
067             */
068            public static final String TABLE_NAME = "DLFileVersion";
069            public static final Object[][] TABLE_COLUMNS = {
070                            { "uuid_", Types.VARCHAR },
071                            { "fileVersionId", 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                            { "fileEntryId", Types.BIGINT },
081                            { "extension", Types.VARCHAR },
082                            { "mimeType", Types.VARCHAR },
083                            { "title", Types.VARCHAR },
084                            { "description", Types.VARCHAR },
085                            { "changeLog", Types.VARCHAR },
086                            { "extraSettings", Types.CLOB },
087                            { "fileEntryTypeId", Types.BIGINT },
088                            { "version", Types.VARCHAR },
089                            { "size_", Types.BIGINT },
090                            { "checksum", Types.VARCHAR },
091                            { "status", Types.INTEGER },
092                            { "statusByUserId", Types.BIGINT },
093                            { "statusByUserName", Types.VARCHAR },
094                            { "statusDate", Types.TIMESTAMP }
095                    };
096            public static final String TABLE_SQL_CREATE = "create table DLFileVersion (uuid_ VARCHAR(75) null,fileVersionId 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,fileEntryId LONG,extension VARCHAR(75) null,mimeType VARCHAR(75) null,title VARCHAR(255) null,description STRING null,changeLog VARCHAR(75) null,extraSettings TEXT null,fileEntryTypeId LONG,version VARCHAR(75) null,size_ LONG,checksum VARCHAR(75) null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
097            public static final String TABLE_SQL_DROP = "drop table DLFileVersion";
098            public static final String ORDER_BY_JPQL = " ORDER BY dlFileVersion.fileEntryId DESC, dlFileVersion.createDate DESC";
099            public static final String ORDER_BY_SQL = " ORDER BY DLFileVersion.fileEntryId DESC, DLFileVersion.createDate DESC";
100            public static final String DATA_SOURCE = "liferayDataSource";
101            public static final String SESSION_FACTORY = "liferaySessionFactory";
102            public static final String TX_MANAGER = "liferayTransactionManager";
103            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
104                                    "value.object.entity.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFileVersion"),
105                            true);
106            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
107                                    "value.object.finder.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFileVersion"),
108                            true);
109            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
110                                    "value.object.column.bitmask.enabled.com.liferay.portlet.documentlibrary.model.DLFileVersion"),
111                            true);
112            public static long COMPANYID_COLUMN_BITMASK = 1L;
113            public static long FILEENTRYID_COLUMN_BITMASK = 2L;
114            public static long FOLDERID_COLUMN_BITMASK = 4L;
115            public static long GROUPID_COLUMN_BITMASK = 8L;
116            public static long STATUS_COLUMN_BITMASK = 16L;
117            public static long TITLE_COLUMN_BITMASK = 32L;
118            public static long UUID_COLUMN_BITMASK = 64L;
119            public static long VERSION_COLUMN_BITMASK = 128L;
120    
121            /**
122             * Converts the soap model instance into a normal model instance.
123             *
124             * @param soapModel the soap model instance to convert
125             * @return the normal model instance
126             */
127            public static DLFileVersion toModel(DLFileVersionSoap soapModel) {
128                    if (soapModel == null) {
129                            return null;
130                    }
131    
132                    DLFileVersion model = new DLFileVersionImpl();
133    
134                    model.setUuid(soapModel.getUuid());
135                    model.setFileVersionId(soapModel.getFileVersionId());
136                    model.setGroupId(soapModel.getGroupId());
137                    model.setCompanyId(soapModel.getCompanyId());
138                    model.setUserId(soapModel.getUserId());
139                    model.setUserName(soapModel.getUserName());
140                    model.setCreateDate(soapModel.getCreateDate());
141                    model.setModifiedDate(soapModel.getModifiedDate());
142                    model.setRepositoryId(soapModel.getRepositoryId());
143                    model.setFolderId(soapModel.getFolderId());
144                    model.setFileEntryId(soapModel.getFileEntryId());
145                    model.setExtension(soapModel.getExtension());
146                    model.setMimeType(soapModel.getMimeType());
147                    model.setTitle(soapModel.getTitle());
148                    model.setDescription(soapModel.getDescription());
149                    model.setChangeLog(soapModel.getChangeLog());
150                    model.setExtraSettings(soapModel.getExtraSettings());
151                    model.setFileEntryTypeId(soapModel.getFileEntryTypeId());
152                    model.setVersion(soapModel.getVersion());
153                    model.setSize(soapModel.getSize());
154                    model.setChecksum(soapModel.getChecksum());
155                    model.setStatus(soapModel.getStatus());
156                    model.setStatusByUserId(soapModel.getStatusByUserId());
157                    model.setStatusByUserName(soapModel.getStatusByUserName());
158                    model.setStatusDate(soapModel.getStatusDate());
159    
160                    return model;
161            }
162    
163            /**
164             * Converts the soap model instances into normal model instances.
165             *
166             * @param soapModels the soap model instances to convert
167             * @return the normal model instances
168             */
169            public static List<DLFileVersion> toModels(DLFileVersionSoap[] soapModels) {
170                    if (soapModels == null) {
171                            return null;
172                    }
173    
174                    List<DLFileVersion> models = new ArrayList<DLFileVersion>(soapModels.length);
175    
176                    for (DLFileVersionSoap soapModel : soapModels) {
177                            models.add(toModel(soapModel));
178                    }
179    
180                    return models;
181            }
182    
183            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
184                                    "lock.expiration.time.com.liferay.portlet.documentlibrary.model.DLFileVersion"));
185    
186            public DLFileVersionModelImpl() {
187            }
188    
189            public long getPrimaryKey() {
190                    return _fileVersionId;
191            }
192    
193            public void setPrimaryKey(long primaryKey) {
194                    setFileVersionId(primaryKey);
195            }
196    
197            public Serializable getPrimaryKeyObj() {
198                    return new Long(_fileVersionId);
199            }
200    
201            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
202                    setPrimaryKey(((Long)primaryKeyObj).longValue());
203            }
204    
205            public Class<?> getModelClass() {
206                    return DLFileVersion.class;
207            }
208    
209            public String getModelClassName() {
210                    return DLFileVersion.class.getName();
211            }
212    
213            @Override
214            public Map<String, Object> getModelAttributes() {
215                    Map<String, Object> attributes = new HashMap<String, Object>();
216    
217                    attributes.put("uuid", getUuid());
218                    attributes.put("fileVersionId", getFileVersionId());
219                    attributes.put("groupId", getGroupId());
220                    attributes.put("companyId", getCompanyId());
221                    attributes.put("userId", getUserId());
222                    attributes.put("userName", getUserName());
223                    attributes.put("createDate", getCreateDate());
224                    attributes.put("modifiedDate", getModifiedDate());
225                    attributes.put("repositoryId", getRepositoryId());
226                    attributes.put("folderId", getFolderId());
227                    attributes.put("fileEntryId", getFileEntryId());
228                    attributes.put("extension", getExtension());
229                    attributes.put("mimeType", getMimeType());
230                    attributes.put("title", getTitle());
231                    attributes.put("description", getDescription());
232                    attributes.put("changeLog", getChangeLog());
233                    attributes.put("extraSettings", getExtraSettings());
234                    attributes.put("fileEntryTypeId", getFileEntryTypeId());
235                    attributes.put("version", getVersion());
236                    attributes.put("size", getSize());
237                    attributes.put("checksum", getChecksum());
238                    attributes.put("status", getStatus());
239                    attributes.put("statusByUserId", getStatusByUserId());
240                    attributes.put("statusByUserName", getStatusByUserName());
241                    attributes.put("statusDate", getStatusDate());
242    
243                    return attributes;
244            }
245    
246            @Override
247            public void setModelAttributes(Map<String, Object> attributes) {
248                    String uuid = (String)attributes.get("uuid");
249    
250                    if (uuid != null) {
251                            setUuid(uuid);
252                    }
253    
254                    Long fileVersionId = (Long)attributes.get("fileVersionId");
255    
256                    if (fileVersionId != null) {
257                            setFileVersionId(fileVersionId);
258                    }
259    
260                    Long groupId = (Long)attributes.get("groupId");
261    
262                    if (groupId != null) {
263                            setGroupId(groupId);
264                    }
265    
266                    Long companyId = (Long)attributes.get("companyId");
267    
268                    if (companyId != null) {
269                            setCompanyId(companyId);
270                    }
271    
272                    Long userId = (Long)attributes.get("userId");
273    
274                    if (userId != null) {
275                            setUserId(userId);
276                    }
277    
278                    String userName = (String)attributes.get("userName");
279    
280                    if (userName != null) {
281                            setUserName(userName);
282                    }
283    
284                    Date createDate = (Date)attributes.get("createDate");
285    
286                    if (createDate != null) {
287                            setCreateDate(createDate);
288                    }
289    
290                    Date modifiedDate = (Date)attributes.get("modifiedDate");
291    
292                    if (modifiedDate != null) {
293                            setModifiedDate(modifiedDate);
294                    }
295    
296                    Long repositoryId = (Long)attributes.get("repositoryId");
297    
298                    if (repositoryId != null) {
299                            setRepositoryId(repositoryId);
300                    }
301    
302                    Long folderId = (Long)attributes.get("folderId");
303    
304                    if (folderId != null) {
305                            setFolderId(folderId);
306                    }
307    
308                    Long fileEntryId = (Long)attributes.get("fileEntryId");
309    
310                    if (fileEntryId != null) {
311                            setFileEntryId(fileEntryId);
312                    }
313    
314                    String extension = (String)attributes.get("extension");
315    
316                    if (extension != null) {
317                            setExtension(extension);
318                    }
319    
320                    String mimeType = (String)attributes.get("mimeType");
321    
322                    if (mimeType != null) {
323                            setMimeType(mimeType);
324                    }
325    
326                    String title = (String)attributes.get("title");
327    
328                    if (title != null) {
329                            setTitle(title);
330                    }
331    
332                    String description = (String)attributes.get("description");
333    
334                    if (description != null) {
335                            setDescription(description);
336                    }
337    
338                    String changeLog = (String)attributes.get("changeLog");
339    
340                    if (changeLog != null) {
341                            setChangeLog(changeLog);
342                    }
343    
344                    String extraSettings = (String)attributes.get("extraSettings");
345    
346                    if (extraSettings != null) {
347                            setExtraSettings(extraSettings);
348                    }
349    
350                    Long fileEntryTypeId = (Long)attributes.get("fileEntryTypeId");
351    
352                    if (fileEntryTypeId != null) {
353                            setFileEntryTypeId(fileEntryTypeId);
354                    }
355    
356                    String version = (String)attributes.get("version");
357    
358                    if (version != null) {
359                            setVersion(version);
360                    }
361    
362                    Long size = (Long)attributes.get("size");
363    
364                    if (size != null) {
365                            setSize(size);
366                    }
367    
368                    String checksum = (String)attributes.get("checksum");
369    
370                    if (checksum != null) {
371                            setChecksum(checksum);
372                    }
373    
374                    Integer status = (Integer)attributes.get("status");
375    
376                    if (status != null) {
377                            setStatus(status);
378                    }
379    
380                    Long statusByUserId = (Long)attributes.get("statusByUserId");
381    
382                    if (statusByUserId != null) {
383                            setStatusByUserId(statusByUserId);
384                    }
385    
386                    String statusByUserName = (String)attributes.get("statusByUserName");
387    
388                    if (statusByUserName != null) {
389                            setStatusByUserName(statusByUserName);
390                    }
391    
392                    Date statusDate = (Date)attributes.get("statusDate");
393    
394                    if (statusDate != null) {
395                            setStatusDate(statusDate);
396                    }
397            }
398    
399            @JSON
400            public String getUuid() {
401                    if (_uuid == null) {
402                            return StringPool.BLANK;
403                    }
404                    else {
405                            return _uuid;
406                    }
407            }
408    
409            public void setUuid(String uuid) {
410                    if (_originalUuid == null) {
411                            _originalUuid = _uuid;
412                    }
413    
414                    _uuid = uuid;
415            }
416    
417            public String getOriginalUuid() {
418                    return GetterUtil.getString(_originalUuid);
419            }
420    
421            @JSON
422            public long getFileVersionId() {
423                    return _fileVersionId;
424            }
425    
426            public void setFileVersionId(long fileVersionId) {
427                    _fileVersionId = fileVersionId;
428            }
429    
430            @JSON
431            public long getGroupId() {
432                    return _groupId;
433            }
434    
435            public void setGroupId(long groupId) {
436                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
437    
438                    if (!_setOriginalGroupId) {
439                            _setOriginalGroupId = true;
440    
441                            _originalGroupId = _groupId;
442                    }
443    
444                    _groupId = groupId;
445            }
446    
447            public long getOriginalGroupId() {
448                    return _originalGroupId;
449            }
450    
451            @JSON
452            public long getCompanyId() {
453                    return _companyId;
454            }
455    
456            public void setCompanyId(long companyId) {
457                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
458    
459                    if (!_setOriginalCompanyId) {
460                            _setOriginalCompanyId = true;
461    
462                            _originalCompanyId = _companyId;
463                    }
464    
465                    _companyId = companyId;
466            }
467    
468            public long getOriginalCompanyId() {
469                    return _originalCompanyId;
470            }
471    
472            @JSON
473            public long getUserId() {
474                    return _userId;
475            }
476    
477            public void setUserId(long userId) {
478                    _userId = userId;
479            }
480    
481            public String getUserUuid() throws SystemException {
482                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
483            }
484    
485            public void setUserUuid(String userUuid) {
486                    _userUuid = userUuid;
487            }
488    
489            @JSON
490            public String getUserName() {
491                    if (_userName == null) {
492                            return StringPool.BLANK;
493                    }
494                    else {
495                            return _userName;
496                    }
497            }
498    
499            public void setUserName(String userName) {
500                    _userName = userName;
501            }
502    
503            @JSON
504            public Date getCreateDate() {
505                    return _createDate;
506            }
507    
508            public void setCreateDate(Date createDate) {
509                    _columnBitmask = -1L;
510    
511                    _createDate = createDate;
512            }
513    
514            @JSON
515            public Date getModifiedDate() {
516                    return _modifiedDate;
517            }
518    
519            public void setModifiedDate(Date modifiedDate) {
520                    _modifiedDate = modifiedDate;
521            }
522    
523            @JSON
524            public long getRepositoryId() {
525                    return _repositoryId;
526            }
527    
528            public void setRepositoryId(long repositoryId) {
529                    _repositoryId = repositoryId;
530            }
531    
532            @JSON
533            public long getFolderId() {
534                    return _folderId;
535            }
536    
537            public void setFolderId(long folderId) {
538                    _columnBitmask |= FOLDERID_COLUMN_BITMASK;
539    
540                    if (!_setOriginalFolderId) {
541                            _setOriginalFolderId = true;
542    
543                            _originalFolderId = _folderId;
544                    }
545    
546                    _folderId = folderId;
547            }
548    
549            public long getOriginalFolderId() {
550                    return _originalFolderId;
551            }
552    
553            @JSON
554            public long getFileEntryId() {
555                    return _fileEntryId;
556            }
557    
558            public void setFileEntryId(long fileEntryId) {
559                    _columnBitmask = -1L;
560    
561                    if (!_setOriginalFileEntryId) {
562                            _setOriginalFileEntryId = true;
563    
564                            _originalFileEntryId = _fileEntryId;
565                    }
566    
567                    _fileEntryId = fileEntryId;
568            }
569    
570            public long getOriginalFileEntryId() {
571                    return _originalFileEntryId;
572            }
573    
574            @JSON
575            public String getExtension() {
576                    if (_extension == null) {
577                            return StringPool.BLANK;
578                    }
579                    else {
580                            return _extension;
581                    }
582            }
583    
584            public void setExtension(String extension) {
585                    _extension = extension;
586            }
587    
588            @JSON
589            public String getMimeType() {
590                    if (_mimeType == null) {
591                            return StringPool.BLANK;
592                    }
593                    else {
594                            return _mimeType;
595                    }
596            }
597    
598            public void setMimeType(String mimeType) {
599                    _mimeType = mimeType;
600            }
601    
602            @JSON
603            public String getTitle() {
604                    if (_title == null) {
605                            return StringPool.BLANK;
606                    }
607                    else {
608                            return _title;
609                    }
610            }
611    
612            public void setTitle(String title) {
613                    _columnBitmask |= TITLE_COLUMN_BITMASK;
614    
615                    if (_originalTitle == null) {
616                            _originalTitle = _title;
617                    }
618    
619                    _title = title;
620            }
621    
622            public String getOriginalTitle() {
623                    return GetterUtil.getString(_originalTitle);
624            }
625    
626            @JSON
627            public String getDescription() {
628                    if (_description == null) {
629                            return StringPool.BLANK;
630                    }
631                    else {
632                            return _description;
633                    }
634            }
635    
636            public void setDescription(String description) {
637                    _description = description;
638            }
639    
640            @JSON
641            public String getChangeLog() {
642                    if (_changeLog == null) {
643                            return StringPool.BLANK;
644                    }
645                    else {
646                            return _changeLog;
647                    }
648            }
649    
650            public void setChangeLog(String changeLog) {
651                    _changeLog = changeLog;
652            }
653    
654            @JSON
655            public String getExtraSettings() {
656                    if (_extraSettings == null) {
657                            return StringPool.BLANK;
658                    }
659                    else {
660                            return _extraSettings;
661                    }
662            }
663    
664            public void setExtraSettings(String extraSettings) {
665                    _extraSettings = extraSettings;
666            }
667    
668            @JSON
669            public long getFileEntryTypeId() {
670                    return _fileEntryTypeId;
671            }
672    
673            public void setFileEntryTypeId(long fileEntryTypeId) {
674                    _fileEntryTypeId = fileEntryTypeId;
675            }
676    
677            @JSON
678            public String getVersion() {
679                    if (_version == null) {
680                            return StringPool.BLANK;
681                    }
682                    else {
683                            return _version;
684                    }
685            }
686    
687            public void setVersion(String version) {
688                    _columnBitmask |= VERSION_COLUMN_BITMASK;
689    
690                    if (_originalVersion == null) {
691                            _originalVersion = _version;
692                    }
693    
694                    _version = version;
695            }
696    
697            public String getOriginalVersion() {
698                    return GetterUtil.getString(_originalVersion);
699            }
700    
701            @JSON
702            public long getSize() {
703                    return _size;
704            }
705    
706            public void setSize(long size) {
707                    _size = size;
708            }
709    
710            @JSON
711            public String getChecksum() {
712                    if (_checksum == null) {
713                            return StringPool.BLANK;
714                    }
715                    else {
716                            return _checksum;
717                    }
718            }
719    
720            public void setChecksum(String checksum) {
721                    _checksum = checksum;
722            }
723    
724            @JSON
725            public int getStatus() {
726                    return _status;
727            }
728    
729            public void setStatus(int status) {
730                    _columnBitmask |= STATUS_COLUMN_BITMASK;
731    
732                    if (!_setOriginalStatus) {
733                            _setOriginalStatus = true;
734    
735                            _originalStatus = _status;
736                    }
737    
738                    _status = status;
739            }
740    
741            public int getOriginalStatus() {
742                    return _originalStatus;
743            }
744    
745            @JSON
746            public long getStatusByUserId() {
747                    return _statusByUserId;
748            }
749    
750            public void setStatusByUserId(long statusByUserId) {
751                    _statusByUserId = statusByUserId;
752            }
753    
754            public String getStatusByUserUuid() throws SystemException {
755                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
756                            _statusByUserUuid);
757            }
758    
759            public void setStatusByUserUuid(String statusByUserUuid) {
760                    _statusByUserUuid = statusByUserUuid;
761            }
762    
763            @JSON
764            public String getStatusByUserName() {
765                    if (_statusByUserName == null) {
766                            return StringPool.BLANK;
767                    }
768                    else {
769                            return _statusByUserName;
770                    }
771            }
772    
773            public void setStatusByUserName(String statusByUserName) {
774                    _statusByUserName = statusByUserName;
775            }
776    
777            @JSON
778            public Date getStatusDate() {
779                    return _statusDate;
780            }
781    
782            public void setStatusDate(Date statusDate) {
783                    _statusDate = statusDate;
784            }
785    
786            /**
787             * @deprecated {@link #isApproved}
788             */
789            public boolean getApproved() {
790                    return isApproved();
791            }
792    
793            public boolean isApproved() {
794                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
795                            return true;
796                    }
797                    else {
798                            return false;
799                    }
800            }
801    
802            public boolean isDenied() {
803                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
804                            return true;
805                    }
806                    else {
807                            return false;
808                    }
809            }
810    
811            public boolean isDraft() {
812                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
813                            return true;
814                    }
815                    else {
816                            return false;
817                    }
818            }
819    
820            public boolean isExpired() {
821                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
822                            return true;
823                    }
824                    else {
825                            return false;
826                    }
827            }
828    
829            public boolean isInactive() {
830                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
831                            return true;
832                    }
833                    else {
834                            return false;
835                    }
836            }
837    
838            public boolean isIncomplete() {
839                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
840                            return true;
841                    }
842                    else {
843                            return false;
844                    }
845            }
846    
847            public boolean isInTrash() {
848                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
849                            return true;
850                    }
851                    else {
852                            return false;
853                    }
854            }
855    
856            public boolean isPending() {
857                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
858                            return true;
859                    }
860                    else {
861                            return false;
862                    }
863            }
864    
865            public boolean isScheduled() {
866                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
867                            return true;
868                    }
869                    else {
870                            return false;
871                    }
872            }
873    
874            public long getColumnBitmask() {
875                    return _columnBitmask;
876            }
877    
878            @Override
879            public ExpandoBridge getExpandoBridge() {
880                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
881                            DLFileVersion.class.getName(), getPrimaryKey());
882            }
883    
884            @Override
885            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
886                    ExpandoBridge expandoBridge = getExpandoBridge();
887    
888                    expandoBridge.setAttributes(serviceContext);
889            }
890    
891            @Override
892            public DLFileVersion toEscapedModel() {
893                    if (_escapedModelProxy == null) {
894                            _escapedModelProxy = (DLFileVersion)ProxyUtil.newProxyInstance(_classLoader,
895                                            _escapedModelProxyInterfaces,
896                                            new AutoEscapeBeanHandler(this));
897                    }
898    
899                    return _escapedModelProxy;
900            }
901    
902            @Override
903            public Object clone() {
904                    DLFileVersionImpl dlFileVersionImpl = new DLFileVersionImpl();
905    
906                    dlFileVersionImpl.setUuid(getUuid());
907                    dlFileVersionImpl.setFileVersionId(getFileVersionId());
908                    dlFileVersionImpl.setGroupId(getGroupId());
909                    dlFileVersionImpl.setCompanyId(getCompanyId());
910                    dlFileVersionImpl.setUserId(getUserId());
911                    dlFileVersionImpl.setUserName(getUserName());
912                    dlFileVersionImpl.setCreateDate(getCreateDate());
913                    dlFileVersionImpl.setModifiedDate(getModifiedDate());
914                    dlFileVersionImpl.setRepositoryId(getRepositoryId());
915                    dlFileVersionImpl.setFolderId(getFolderId());
916                    dlFileVersionImpl.setFileEntryId(getFileEntryId());
917                    dlFileVersionImpl.setExtension(getExtension());
918                    dlFileVersionImpl.setMimeType(getMimeType());
919                    dlFileVersionImpl.setTitle(getTitle());
920                    dlFileVersionImpl.setDescription(getDescription());
921                    dlFileVersionImpl.setChangeLog(getChangeLog());
922                    dlFileVersionImpl.setExtraSettings(getExtraSettings());
923                    dlFileVersionImpl.setFileEntryTypeId(getFileEntryTypeId());
924                    dlFileVersionImpl.setVersion(getVersion());
925                    dlFileVersionImpl.setSize(getSize());
926                    dlFileVersionImpl.setChecksum(getChecksum());
927                    dlFileVersionImpl.setStatus(getStatus());
928                    dlFileVersionImpl.setStatusByUserId(getStatusByUserId());
929                    dlFileVersionImpl.setStatusByUserName(getStatusByUserName());
930                    dlFileVersionImpl.setStatusDate(getStatusDate());
931    
932                    dlFileVersionImpl.resetOriginalValues();
933    
934                    return dlFileVersionImpl;
935            }
936    
937            public int compareTo(DLFileVersion dlFileVersion) {
938                    int value = 0;
939    
940                    if (getFileEntryId() < dlFileVersion.getFileEntryId()) {
941                            value = -1;
942                    }
943                    else if (getFileEntryId() > dlFileVersion.getFileEntryId()) {
944                            value = 1;
945                    }
946                    else {
947                            value = 0;
948                    }
949    
950                    value = value * -1;
951    
952                    if (value != 0) {
953                            return value;
954                    }
955    
956                    value = DateUtil.compareTo(getCreateDate(),
957                                    dlFileVersion.getCreateDate());
958    
959                    value = value * -1;
960    
961                    if (value != 0) {
962                            return value;
963                    }
964    
965                    return 0;
966            }
967    
968            @Override
969            public boolean equals(Object obj) {
970                    if (obj == null) {
971                            return false;
972                    }
973    
974                    DLFileVersion dlFileVersion = null;
975    
976                    try {
977                            dlFileVersion = (DLFileVersion)obj;
978                    }
979                    catch (ClassCastException cce) {
980                            return false;
981                    }
982    
983                    long primaryKey = dlFileVersion.getPrimaryKey();
984    
985                    if (getPrimaryKey() == primaryKey) {
986                            return true;
987                    }
988                    else {
989                            return false;
990                    }
991            }
992    
993            @Override
994            public int hashCode() {
995                    return (int)getPrimaryKey();
996            }
997    
998            @Override
999            public void resetOriginalValues() {
1000                    DLFileVersionModelImpl dlFileVersionModelImpl = this;
1001    
1002                    dlFileVersionModelImpl._originalUuid = dlFileVersionModelImpl._uuid;
1003    
1004                    dlFileVersionModelImpl._originalGroupId = dlFileVersionModelImpl._groupId;
1005    
1006                    dlFileVersionModelImpl._setOriginalGroupId = false;
1007    
1008                    dlFileVersionModelImpl._originalCompanyId = dlFileVersionModelImpl._companyId;
1009    
1010                    dlFileVersionModelImpl._setOriginalCompanyId = false;
1011    
1012                    dlFileVersionModelImpl._originalFolderId = dlFileVersionModelImpl._folderId;
1013    
1014                    dlFileVersionModelImpl._setOriginalFolderId = false;
1015    
1016                    dlFileVersionModelImpl._originalFileEntryId = dlFileVersionModelImpl._fileEntryId;
1017    
1018                    dlFileVersionModelImpl._setOriginalFileEntryId = false;
1019    
1020                    dlFileVersionModelImpl._originalTitle = dlFileVersionModelImpl._title;
1021    
1022                    dlFileVersionModelImpl._originalVersion = dlFileVersionModelImpl._version;
1023    
1024                    dlFileVersionModelImpl._originalStatus = dlFileVersionModelImpl._status;
1025    
1026                    dlFileVersionModelImpl._setOriginalStatus = false;
1027    
1028                    dlFileVersionModelImpl._columnBitmask = 0;
1029            }
1030    
1031            @Override
1032            public CacheModel<DLFileVersion> toCacheModel() {
1033                    DLFileVersionCacheModel dlFileVersionCacheModel = new DLFileVersionCacheModel();
1034    
1035                    dlFileVersionCacheModel.uuid = getUuid();
1036    
1037                    String uuid = dlFileVersionCacheModel.uuid;
1038    
1039                    if ((uuid != null) && (uuid.length() == 0)) {
1040                            dlFileVersionCacheModel.uuid = null;
1041                    }
1042    
1043                    dlFileVersionCacheModel.fileVersionId = getFileVersionId();
1044    
1045                    dlFileVersionCacheModel.groupId = getGroupId();
1046    
1047                    dlFileVersionCacheModel.companyId = getCompanyId();
1048    
1049                    dlFileVersionCacheModel.userId = getUserId();
1050    
1051                    dlFileVersionCacheModel.userName = getUserName();
1052    
1053                    String userName = dlFileVersionCacheModel.userName;
1054    
1055                    if ((userName != null) && (userName.length() == 0)) {
1056                            dlFileVersionCacheModel.userName = null;
1057                    }
1058    
1059                    Date createDate = getCreateDate();
1060    
1061                    if (createDate != null) {
1062                            dlFileVersionCacheModel.createDate = createDate.getTime();
1063                    }
1064                    else {
1065                            dlFileVersionCacheModel.createDate = Long.MIN_VALUE;
1066                    }
1067    
1068                    Date modifiedDate = getModifiedDate();
1069    
1070                    if (modifiedDate != null) {
1071                            dlFileVersionCacheModel.modifiedDate = modifiedDate.getTime();
1072                    }
1073                    else {
1074                            dlFileVersionCacheModel.modifiedDate = Long.MIN_VALUE;
1075                    }
1076    
1077                    dlFileVersionCacheModel.repositoryId = getRepositoryId();
1078    
1079                    dlFileVersionCacheModel.folderId = getFolderId();
1080    
1081                    dlFileVersionCacheModel.fileEntryId = getFileEntryId();
1082    
1083                    dlFileVersionCacheModel.extension = getExtension();
1084    
1085                    String extension = dlFileVersionCacheModel.extension;
1086    
1087                    if ((extension != null) && (extension.length() == 0)) {
1088                            dlFileVersionCacheModel.extension = null;
1089                    }
1090    
1091                    dlFileVersionCacheModel.mimeType = getMimeType();
1092    
1093                    String mimeType = dlFileVersionCacheModel.mimeType;
1094    
1095                    if ((mimeType != null) && (mimeType.length() == 0)) {
1096                            dlFileVersionCacheModel.mimeType = null;
1097                    }
1098    
1099                    dlFileVersionCacheModel.title = getTitle();
1100    
1101                    String title = dlFileVersionCacheModel.title;
1102    
1103                    if ((title != null) && (title.length() == 0)) {
1104                            dlFileVersionCacheModel.title = null;
1105                    }
1106    
1107                    dlFileVersionCacheModel.description = getDescription();
1108    
1109                    String description = dlFileVersionCacheModel.description;
1110    
1111                    if ((description != null) && (description.length() == 0)) {
1112                            dlFileVersionCacheModel.description = null;
1113                    }
1114    
1115                    dlFileVersionCacheModel.changeLog = getChangeLog();
1116    
1117                    String changeLog = dlFileVersionCacheModel.changeLog;
1118    
1119                    if ((changeLog != null) && (changeLog.length() == 0)) {
1120                            dlFileVersionCacheModel.changeLog = null;
1121                    }
1122    
1123                    dlFileVersionCacheModel.extraSettings = getExtraSettings();
1124    
1125                    String extraSettings = dlFileVersionCacheModel.extraSettings;
1126    
1127                    if ((extraSettings != null) && (extraSettings.length() == 0)) {
1128                            dlFileVersionCacheModel.extraSettings = null;
1129                    }
1130    
1131                    dlFileVersionCacheModel.fileEntryTypeId = getFileEntryTypeId();
1132    
1133                    dlFileVersionCacheModel.version = getVersion();
1134    
1135                    String version = dlFileVersionCacheModel.version;
1136    
1137                    if ((version != null) && (version.length() == 0)) {
1138                            dlFileVersionCacheModel.version = null;
1139                    }
1140    
1141                    dlFileVersionCacheModel.size = getSize();
1142    
1143                    dlFileVersionCacheModel.checksum = getChecksum();
1144    
1145                    String checksum = dlFileVersionCacheModel.checksum;
1146    
1147                    if ((checksum != null) && (checksum.length() == 0)) {
1148                            dlFileVersionCacheModel.checksum = null;
1149                    }
1150    
1151                    dlFileVersionCacheModel.status = getStatus();
1152    
1153                    dlFileVersionCacheModel.statusByUserId = getStatusByUserId();
1154    
1155                    dlFileVersionCacheModel.statusByUserName = getStatusByUserName();
1156    
1157                    String statusByUserName = dlFileVersionCacheModel.statusByUserName;
1158    
1159                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1160                            dlFileVersionCacheModel.statusByUserName = null;
1161                    }
1162    
1163                    Date statusDate = getStatusDate();
1164    
1165                    if (statusDate != null) {
1166                            dlFileVersionCacheModel.statusDate = statusDate.getTime();
1167                    }
1168                    else {
1169                            dlFileVersionCacheModel.statusDate = Long.MIN_VALUE;
1170                    }
1171    
1172                    return dlFileVersionCacheModel;
1173            }
1174    
1175            @Override
1176            public String toString() {
1177                    StringBundler sb = new StringBundler(51);
1178    
1179                    sb.append("{uuid=");
1180                    sb.append(getUuid());
1181                    sb.append(", fileVersionId=");
1182                    sb.append(getFileVersionId());
1183                    sb.append(", groupId=");
1184                    sb.append(getGroupId());
1185                    sb.append(", companyId=");
1186                    sb.append(getCompanyId());
1187                    sb.append(", userId=");
1188                    sb.append(getUserId());
1189                    sb.append(", userName=");
1190                    sb.append(getUserName());
1191                    sb.append(", createDate=");
1192                    sb.append(getCreateDate());
1193                    sb.append(", modifiedDate=");
1194                    sb.append(getModifiedDate());
1195                    sb.append(", repositoryId=");
1196                    sb.append(getRepositoryId());
1197                    sb.append(", folderId=");
1198                    sb.append(getFolderId());
1199                    sb.append(", fileEntryId=");
1200                    sb.append(getFileEntryId());
1201                    sb.append(", extension=");
1202                    sb.append(getExtension());
1203                    sb.append(", mimeType=");
1204                    sb.append(getMimeType());
1205                    sb.append(", title=");
1206                    sb.append(getTitle());
1207                    sb.append(", description=");
1208                    sb.append(getDescription());
1209                    sb.append(", changeLog=");
1210                    sb.append(getChangeLog());
1211                    sb.append(", extraSettings=");
1212                    sb.append(getExtraSettings());
1213                    sb.append(", fileEntryTypeId=");
1214                    sb.append(getFileEntryTypeId());
1215                    sb.append(", version=");
1216                    sb.append(getVersion());
1217                    sb.append(", size=");
1218                    sb.append(getSize());
1219                    sb.append(", checksum=");
1220                    sb.append(getChecksum());
1221                    sb.append(", status=");
1222                    sb.append(getStatus());
1223                    sb.append(", statusByUserId=");
1224                    sb.append(getStatusByUserId());
1225                    sb.append(", statusByUserName=");
1226                    sb.append(getStatusByUserName());
1227                    sb.append(", statusDate=");
1228                    sb.append(getStatusDate());
1229                    sb.append("}");
1230    
1231                    return sb.toString();
1232            }
1233    
1234            public String toXmlString() {
1235                    StringBundler sb = new StringBundler(79);
1236    
1237                    sb.append("<model><model-name>");
1238                    sb.append("com.liferay.portlet.documentlibrary.model.DLFileVersion");
1239                    sb.append("</model-name>");
1240    
1241                    sb.append(
1242                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1243                    sb.append(getUuid());
1244                    sb.append("]]></column-value></column>");
1245                    sb.append(
1246                            "<column><column-name>fileVersionId</column-name><column-value><![CDATA[");
1247                    sb.append(getFileVersionId());
1248                    sb.append("]]></column-value></column>");
1249                    sb.append(
1250                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1251                    sb.append(getGroupId());
1252                    sb.append("]]></column-value></column>");
1253                    sb.append(
1254                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1255                    sb.append(getCompanyId());
1256                    sb.append("]]></column-value></column>");
1257                    sb.append(
1258                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1259                    sb.append(getUserId());
1260                    sb.append("]]></column-value></column>");
1261                    sb.append(
1262                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1263                    sb.append(getUserName());
1264                    sb.append("]]></column-value></column>");
1265                    sb.append(
1266                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1267                    sb.append(getCreateDate());
1268                    sb.append("]]></column-value></column>");
1269                    sb.append(
1270                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1271                    sb.append(getModifiedDate());
1272                    sb.append("]]></column-value></column>");
1273                    sb.append(
1274                            "<column><column-name>repositoryId</column-name><column-value><![CDATA[");
1275                    sb.append(getRepositoryId());
1276                    sb.append("]]></column-value></column>");
1277                    sb.append(
1278                            "<column><column-name>folderId</column-name><column-value><![CDATA[");
1279                    sb.append(getFolderId());
1280                    sb.append("]]></column-value></column>");
1281                    sb.append(
1282                            "<column><column-name>fileEntryId</column-name><column-value><![CDATA[");
1283                    sb.append(getFileEntryId());
1284                    sb.append("]]></column-value></column>");
1285                    sb.append(
1286                            "<column><column-name>extension</column-name><column-value><![CDATA[");
1287                    sb.append(getExtension());
1288                    sb.append("]]></column-value></column>");
1289                    sb.append(
1290                            "<column><column-name>mimeType</column-name><column-value><![CDATA[");
1291                    sb.append(getMimeType());
1292                    sb.append("]]></column-value></column>");
1293                    sb.append(
1294                            "<column><column-name>title</column-name><column-value><![CDATA[");
1295                    sb.append(getTitle());
1296                    sb.append("]]></column-value></column>");
1297                    sb.append(
1298                            "<column><column-name>description</column-name><column-value><![CDATA[");
1299                    sb.append(getDescription());
1300                    sb.append("]]></column-value></column>");
1301                    sb.append(
1302                            "<column><column-name>changeLog</column-name><column-value><![CDATA[");
1303                    sb.append(getChangeLog());
1304                    sb.append("]]></column-value></column>");
1305                    sb.append(
1306                            "<column><column-name>extraSettings</column-name><column-value><![CDATA[");
1307                    sb.append(getExtraSettings());
1308                    sb.append("]]></column-value></column>");
1309                    sb.append(
1310                            "<column><column-name>fileEntryTypeId</column-name><column-value><![CDATA[");
1311                    sb.append(getFileEntryTypeId());
1312                    sb.append("]]></column-value></column>");
1313                    sb.append(
1314                            "<column><column-name>version</column-name><column-value><![CDATA[");
1315                    sb.append(getVersion());
1316                    sb.append("]]></column-value></column>");
1317                    sb.append(
1318                            "<column><column-name>size</column-name><column-value><![CDATA[");
1319                    sb.append(getSize());
1320                    sb.append("]]></column-value></column>");
1321                    sb.append(
1322                            "<column><column-name>checksum</column-name><column-value><![CDATA[");
1323                    sb.append(getChecksum());
1324                    sb.append("]]></column-value></column>");
1325                    sb.append(
1326                            "<column><column-name>status</column-name><column-value><![CDATA[");
1327                    sb.append(getStatus());
1328                    sb.append("]]></column-value></column>");
1329                    sb.append(
1330                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1331                    sb.append(getStatusByUserId());
1332                    sb.append("]]></column-value></column>");
1333                    sb.append(
1334                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1335                    sb.append(getStatusByUserName());
1336                    sb.append("]]></column-value></column>");
1337                    sb.append(
1338                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1339                    sb.append(getStatusDate());
1340                    sb.append("]]></column-value></column>");
1341    
1342                    sb.append("</model>");
1343    
1344                    return sb.toString();
1345            }
1346    
1347            private static ClassLoader _classLoader = DLFileVersion.class.getClassLoader();
1348            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
1349                            DLFileVersion.class
1350                    };
1351            private String _uuid;
1352            private String _originalUuid;
1353            private long _fileVersionId;
1354            private long _groupId;
1355            private long _originalGroupId;
1356            private boolean _setOriginalGroupId;
1357            private long _companyId;
1358            private long _originalCompanyId;
1359            private boolean _setOriginalCompanyId;
1360            private long _userId;
1361            private String _userUuid;
1362            private String _userName;
1363            private Date _createDate;
1364            private Date _modifiedDate;
1365            private long _repositoryId;
1366            private long _folderId;
1367            private long _originalFolderId;
1368            private boolean _setOriginalFolderId;
1369            private long _fileEntryId;
1370            private long _originalFileEntryId;
1371            private boolean _setOriginalFileEntryId;
1372            private String _extension;
1373            private String _mimeType;
1374            private String _title;
1375            private String _originalTitle;
1376            private String _description;
1377            private String _changeLog;
1378            private String _extraSettings;
1379            private long _fileEntryTypeId;
1380            private String _version;
1381            private String _originalVersion;
1382            private long _size;
1383            private String _checksum;
1384            private int _status;
1385            private int _originalStatus;
1386            private boolean _setOriginalStatus;
1387            private long _statusByUserId;
1388            private String _statusByUserUuid;
1389            private String _statusByUserName;
1390            private Date _statusDate;
1391            private long _columnBitmask;
1392            private DLFileVersion _escapedModelProxy;
1393    }