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