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