001
014
015 package com.liferay.portlet.asset.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.language.LanguageUtil;
021 import com.liferay.portal.kernel.util.GetterUtil;
022 import com.liferay.portal.kernel.util.LocaleUtil;
023 import com.liferay.portal.kernel.util.LocalizationUtil;
024 import com.liferay.portal.kernel.util.ProxyUtil;
025 import com.liferay.portal.kernel.util.StringBundler;
026 import com.liferay.portal.kernel.util.StringPool;
027 import com.liferay.portal.kernel.util.Validator;
028 import com.liferay.portal.model.CacheModel;
029 import com.liferay.portal.model.impl.BaseModelImpl;
030 import com.liferay.portal.service.ServiceContext;
031 import com.liferay.portal.util.PortalUtil;
032
033 import com.liferay.portlet.asset.model.AssetEntry;
034 import com.liferay.portlet.asset.model.AssetEntryModel;
035 import com.liferay.portlet.asset.model.AssetEntrySoap;
036 import com.liferay.portlet.expando.model.ExpandoBridge;
037 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
038
039 import java.io.Serializable;
040
041 import java.sql.Types;
042
043 import java.util.ArrayList;
044 import java.util.Date;
045 import java.util.List;
046 import java.util.Locale;
047 import java.util.Map;
048
049
062 @JSON(strict = true)
063 public class AssetEntryModelImpl extends BaseModelImpl<AssetEntry>
064 implements AssetEntryModel {
065
070 public static final String TABLE_NAME = "AssetEntry";
071 public static final Object[][] TABLE_COLUMNS = {
072 { "entryId", Types.BIGINT },
073 { "groupId", Types.BIGINT },
074 { "companyId", Types.BIGINT },
075 { "userId", Types.BIGINT },
076 { "userName", Types.VARCHAR },
077 { "createDate", Types.TIMESTAMP },
078 { "modifiedDate", Types.TIMESTAMP },
079 { "classNameId", Types.BIGINT },
080 { "classPK", Types.BIGINT },
081 { "classUuid", Types.VARCHAR },
082 { "classTypeId", Types.BIGINT },
083 { "visible", Types.BOOLEAN },
084 { "startDate", Types.TIMESTAMP },
085 { "endDate", Types.TIMESTAMP },
086 { "publishDate", Types.TIMESTAMP },
087 { "expirationDate", Types.TIMESTAMP },
088 { "mimeType", Types.VARCHAR },
089 { "title", Types.VARCHAR },
090 { "description", Types.VARCHAR },
091 { "summary", Types.VARCHAR },
092 { "url", Types.VARCHAR },
093 { "layoutUuid", Types.VARCHAR },
094 { "height", Types.INTEGER },
095 { "width", Types.INTEGER },
096 { "priority", Types.DOUBLE },
097 { "viewCount", Types.INTEGER }
098 };
099 public static final String TABLE_SQL_CREATE = "create table AssetEntry (entryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,classUuid VARCHAR(75) null,classTypeId LONG,visible BOOLEAN,startDate DATE null,endDate DATE null,publishDate DATE null,expirationDate DATE null,mimeType VARCHAR(75) null,title STRING null,description STRING null,summary STRING null,url STRING null,layoutUuid VARCHAR(75) null,height INTEGER,width INTEGER,priority DOUBLE,viewCount INTEGER)";
100 public static final String TABLE_SQL_DROP = "drop table AssetEntry";
101 public static final String DATA_SOURCE = "liferayDataSource";
102 public static final String SESSION_FACTORY = "liferaySessionFactory";
103 public static final String TX_MANAGER = "liferayTransactionManager";
104 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
105 "value.object.entity.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
106 true);
107 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
108 "value.object.finder.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
109 true);
110 public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
111 "value.object.column.bitmask.enabled.com.liferay.portlet.asset.model.AssetEntry"),
112 true);
113 public static long CLASSNAMEID_COLUMN_BITMASK = 1L;
114 public static long CLASSPK_COLUMN_BITMASK = 2L;
115 public static long CLASSUUID_COLUMN_BITMASK = 4L;
116 public static long COMPANYID_COLUMN_BITMASK = 8L;
117 public static long EXPIRATIONDATE_COLUMN_BITMASK = 16L;
118 public static long GROUPID_COLUMN_BITMASK = 32L;
119 public static long PUBLISHDATE_COLUMN_BITMASK = 64L;
120 public static long VISIBLE_COLUMN_BITMASK = 128L;
121
122
128 public static AssetEntry toModel(AssetEntrySoap soapModel) {
129 AssetEntry model = new AssetEntryImpl();
130
131 model.setEntryId(soapModel.getEntryId());
132 model.setGroupId(soapModel.getGroupId());
133 model.setCompanyId(soapModel.getCompanyId());
134 model.setUserId(soapModel.getUserId());
135 model.setUserName(soapModel.getUserName());
136 model.setCreateDate(soapModel.getCreateDate());
137 model.setModifiedDate(soapModel.getModifiedDate());
138 model.setClassNameId(soapModel.getClassNameId());
139 model.setClassPK(soapModel.getClassPK());
140 model.setClassUuid(soapModel.getClassUuid());
141 model.setClassTypeId(soapModel.getClassTypeId());
142 model.setVisible(soapModel.getVisible());
143 model.setStartDate(soapModel.getStartDate());
144 model.setEndDate(soapModel.getEndDate());
145 model.setPublishDate(soapModel.getPublishDate());
146 model.setExpirationDate(soapModel.getExpirationDate());
147 model.setMimeType(soapModel.getMimeType());
148 model.setTitle(soapModel.getTitle());
149 model.setDescription(soapModel.getDescription());
150 model.setSummary(soapModel.getSummary());
151 model.setUrl(soapModel.getUrl());
152 model.setLayoutUuid(soapModel.getLayoutUuid());
153 model.setHeight(soapModel.getHeight());
154 model.setWidth(soapModel.getWidth());
155 model.setPriority(soapModel.getPriority());
156 model.setViewCount(soapModel.getViewCount());
157
158 return model;
159 }
160
161
167 public static List<AssetEntry> toModels(AssetEntrySoap[] soapModels) {
168 List<AssetEntry> models = new ArrayList<AssetEntry>(soapModels.length);
169
170 for (AssetEntrySoap soapModel : soapModels) {
171 models.add(toModel(soapModel));
172 }
173
174 return models;
175 }
176
177 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_NAME = "AssetEntries_AssetCategories";
178 public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_COLUMNS =
179 {
180 { "entryId", Types.BIGINT },
181 { "categoryId", Types.BIGINT }
182 };
183 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_SQL_CREATE =
184 "create table AssetEntries_AssetCategories (entryId LONG not null,categoryId LONG not null,primary key (entryId, categoryId))";
185 public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETCATEGORIES =
186 GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
187 "value.object.finder.cache.enabled.AssetEntries_AssetCategories"),
188 true);
189 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_NAME = "AssetEntries_AssetTags";
190 public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_COLUMNS = {
191 { "entryId", Types.BIGINT },
192 { "tagId", Types.BIGINT }
193 };
194 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_SQL_CREATE = "create table AssetEntries_AssetTags (entryId LONG not null,tagId LONG not null,primary key (entryId, tagId))";
195 public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETTAGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
196 "value.object.finder.cache.enabled.AssetEntries_AssetTags"),
197 true);
198 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
199 "lock.expiration.time.com.liferay.portlet.asset.model.AssetEntry"));
200
201 public AssetEntryModelImpl() {
202 }
203
204 public long getPrimaryKey() {
205 return _entryId;
206 }
207
208 public void setPrimaryKey(long primaryKey) {
209 setEntryId(primaryKey);
210 }
211
212 public Serializable getPrimaryKeyObj() {
213 return new Long(_entryId);
214 }
215
216 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
217 setPrimaryKey(((Long)primaryKeyObj).longValue());
218 }
219
220 public Class<?> getModelClass() {
221 return AssetEntry.class;
222 }
223
224 public String getModelClassName() {
225 return AssetEntry.class.getName();
226 }
227
228 @JSON
229 public long getEntryId() {
230 return _entryId;
231 }
232
233 public void setEntryId(long entryId) {
234 _entryId = entryId;
235 }
236
237 @JSON
238 public long getGroupId() {
239 return _groupId;
240 }
241
242 public void setGroupId(long groupId) {
243 _columnBitmask |= GROUPID_COLUMN_BITMASK;
244
245 if (!_setOriginalGroupId) {
246 _setOriginalGroupId = true;
247
248 _originalGroupId = _groupId;
249 }
250
251 _groupId = groupId;
252 }
253
254 public long getOriginalGroupId() {
255 return _originalGroupId;
256 }
257
258 @JSON
259 public long getCompanyId() {
260 return _companyId;
261 }
262
263 public void setCompanyId(long companyId) {
264 _columnBitmask |= COMPANYID_COLUMN_BITMASK;
265
266 if (!_setOriginalCompanyId) {
267 _setOriginalCompanyId = true;
268
269 _originalCompanyId = _companyId;
270 }
271
272 _companyId = companyId;
273 }
274
275 public long getOriginalCompanyId() {
276 return _originalCompanyId;
277 }
278
279 @JSON
280 public long getUserId() {
281 return _userId;
282 }
283
284 public void setUserId(long userId) {
285 _userId = userId;
286 }
287
288 public String getUserUuid() throws SystemException {
289 return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
290 }
291
292 public void setUserUuid(String userUuid) {
293 _userUuid = userUuid;
294 }
295
296 @JSON
297 public String getUserName() {
298 if (_userName == null) {
299 return StringPool.BLANK;
300 }
301 else {
302 return _userName;
303 }
304 }
305
306 public void setUserName(String userName) {
307 _userName = userName;
308 }
309
310 @JSON
311 public Date getCreateDate() {
312 return _createDate;
313 }
314
315 public void setCreateDate(Date createDate) {
316 _createDate = createDate;
317 }
318
319 @JSON
320 public Date getModifiedDate() {
321 return _modifiedDate;
322 }
323
324 public void setModifiedDate(Date modifiedDate) {
325 _modifiedDate = modifiedDate;
326 }
327
328 public String getClassName() {
329 if (getClassNameId() <= 0) {
330 return StringPool.BLANK;
331 }
332
333 return PortalUtil.getClassName(getClassNameId());
334 }
335
336 @JSON
337 public long getClassNameId() {
338 return _classNameId;
339 }
340
341 public void setClassNameId(long classNameId) {
342 _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
343
344 if (!_setOriginalClassNameId) {
345 _setOriginalClassNameId = true;
346
347 _originalClassNameId = _classNameId;
348 }
349
350 _classNameId = classNameId;
351 }
352
353 public long getOriginalClassNameId() {
354 return _originalClassNameId;
355 }
356
357 @JSON
358 public long getClassPK() {
359 return _classPK;
360 }
361
362 public void setClassPK(long classPK) {
363 _columnBitmask |= CLASSPK_COLUMN_BITMASK;
364
365 if (!_setOriginalClassPK) {
366 _setOriginalClassPK = true;
367
368 _originalClassPK = _classPK;
369 }
370
371 _classPK = classPK;
372 }
373
374 public long getOriginalClassPK() {
375 return _originalClassPK;
376 }
377
378 @JSON
379 public String getClassUuid() {
380 if (_classUuid == null) {
381 return StringPool.BLANK;
382 }
383 else {
384 return _classUuid;
385 }
386 }
387
388 public void setClassUuid(String classUuid) {
389 _columnBitmask |= CLASSUUID_COLUMN_BITMASK;
390
391 if (_originalClassUuid == null) {
392 _originalClassUuid = _classUuid;
393 }
394
395 _classUuid = classUuid;
396 }
397
398 public String getOriginalClassUuid() {
399 return GetterUtil.getString(_originalClassUuid);
400 }
401
402 @JSON
403 public long getClassTypeId() {
404 return _classTypeId;
405 }
406
407 public void setClassTypeId(long classTypeId) {
408 _classTypeId = classTypeId;
409 }
410
411 @JSON
412 public boolean getVisible() {
413 return _visible;
414 }
415
416 public boolean isVisible() {
417 return _visible;
418 }
419
420 public void setVisible(boolean visible) {
421 _columnBitmask |= VISIBLE_COLUMN_BITMASK;
422
423 if (!_setOriginalVisible) {
424 _setOriginalVisible = true;
425
426 _originalVisible = _visible;
427 }
428
429 _visible = visible;
430 }
431
432 public boolean getOriginalVisible() {
433 return _originalVisible;
434 }
435
436 @JSON
437 public Date getStartDate() {
438 return _startDate;
439 }
440
441 public void setStartDate(Date startDate) {
442 _startDate = startDate;
443 }
444
445 @JSON
446 public Date getEndDate() {
447 return _endDate;
448 }
449
450 public void setEndDate(Date endDate) {
451 _endDate = endDate;
452 }
453
454 @JSON
455 public Date getPublishDate() {
456 return _publishDate;
457 }
458
459 public void setPublishDate(Date publishDate) {
460 _columnBitmask |= PUBLISHDATE_COLUMN_BITMASK;
461
462 if (_originalPublishDate == null) {
463 _originalPublishDate = _publishDate;
464 }
465
466 _publishDate = publishDate;
467 }
468
469 public Date getOriginalPublishDate() {
470 return _originalPublishDate;
471 }
472
473 @JSON
474 public Date getExpirationDate() {
475 return _expirationDate;
476 }
477
478 public void setExpirationDate(Date expirationDate) {
479 _columnBitmask |= EXPIRATIONDATE_COLUMN_BITMASK;
480
481 if (_originalExpirationDate == null) {
482 _originalExpirationDate = _expirationDate;
483 }
484
485 _expirationDate = expirationDate;
486 }
487
488 public Date getOriginalExpirationDate() {
489 return _originalExpirationDate;
490 }
491
492 @JSON
493 public String getMimeType() {
494 if (_mimeType == null) {
495 return StringPool.BLANK;
496 }
497 else {
498 return _mimeType;
499 }
500 }
501
502 public void setMimeType(String mimeType) {
503 _mimeType = mimeType;
504 }
505
506 @JSON
507 public String getTitle() {
508 if (_title == null) {
509 return StringPool.BLANK;
510 }
511 else {
512 return _title;
513 }
514 }
515
516 public String getTitle(Locale locale) {
517 String languageId = LocaleUtil.toLanguageId(locale);
518
519 return getTitle(languageId);
520 }
521
522 public String getTitle(Locale locale, boolean useDefault) {
523 String languageId = LocaleUtil.toLanguageId(locale);
524
525 return getTitle(languageId, useDefault);
526 }
527
528 public String getTitle(String languageId) {
529 return LocalizationUtil.getLocalization(getTitle(), languageId);
530 }
531
532 public String getTitle(String languageId, boolean useDefault) {
533 return LocalizationUtil.getLocalization(getTitle(), languageId,
534 useDefault);
535 }
536
537 public String getTitleCurrentLanguageId() {
538 return _titleCurrentLanguageId;
539 }
540
541 @JSON
542 public String getTitleCurrentValue() {
543 Locale locale = getLocale(_titleCurrentLanguageId);
544
545 return getTitle(locale);
546 }
547
548 public Map<Locale, String> getTitleMap() {
549 return LocalizationUtil.getLocalizationMap(getTitle());
550 }
551
552 public void setTitle(String title) {
553 _title = title;
554 }
555
556 public void setTitle(String title, Locale locale) {
557 setTitle(title, locale, LocaleUtil.getDefault());
558 }
559
560 public void setTitle(String title, Locale locale, Locale defaultLocale) {
561 String languageId = LocaleUtil.toLanguageId(locale);
562 String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
563
564 if (Validator.isNotNull(title)) {
565 setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
566 title, languageId, defaultLanguageId));
567 }
568 else {
569 setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
570 languageId));
571 }
572 }
573
574 public void setTitleCurrentLanguageId(String languageId) {
575 _titleCurrentLanguageId = languageId;
576 }
577
578 public void setTitleMap(Map<Locale, String> titleMap) {
579 setTitleMap(titleMap, LocaleUtil.getDefault());
580 }
581
582 public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
583 if (titleMap == null) {
584 return;
585 }
586
587 Locale[] locales = LanguageUtil.getAvailableLocales();
588
589 for (Locale locale : locales) {
590 String title = titleMap.get(locale);
591
592 setTitle(title, locale, defaultLocale);
593 }
594 }
595
596 @JSON
597 public String getDescription() {
598 if (_description == null) {
599 return StringPool.BLANK;
600 }
601 else {
602 return _description;
603 }
604 }
605
606 public void setDescription(String description) {
607 _description = description;
608 }
609
610 @JSON
611 public String getSummary() {
612 if (_summary == null) {
613 return StringPool.BLANK;
614 }
615 else {
616 return _summary;
617 }
618 }
619
620 public void setSummary(String summary) {
621 _summary = summary;
622 }
623
624 @JSON
625 public String getUrl() {
626 if (_url == null) {
627 return StringPool.BLANK;
628 }
629 else {
630 return _url;
631 }
632 }
633
634 public void setUrl(String url) {
635 _url = url;
636 }
637
638 @JSON
639 public String getLayoutUuid() {
640 if (_layoutUuid == null) {
641 return StringPool.BLANK;
642 }
643 else {
644 return _layoutUuid;
645 }
646 }
647
648 public void setLayoutUuid(String layoutUuid) {
649 _layoutUuid = layoutUuid;
650 }
651
652 @JSON
653 public int getHeight() {
654 return _height;
655 }
656
657 public void setHeight(int height) {
658 _height = height;
659 }
660
661 @JSON
662 public int getWidth() {
663 return _width;
664 }
665
666 public void setWidth(int width) {
667 _width = width;
668 }
669
670 @JSON
671 public double getPriority() {
672 return _priority;
673 }
674
675 public void setPriority(double priority) {
676 _priority = priority;
677 }
678
679 @JSON
680 public int getViewCount() {
681 return _viewCount;
682 }
683
684 public void setViewCount(int viewCount) {
685 _viewCount = viewCount;
686 }
687
688 public long getColumnBitmask() {
689 return _columnBitmask;
690 }
691
692 @Override
693 public AssetEntry toEscapedModel() {
694 if (_escapedModelProxy == null) {
695 _escapedModelProxy = (AssetEntry)ProxyUtil.newProxyInstance(_classLoader,
696 _escapedModelProxyInterfaces,
697 new AutoEscapeBeanHandler(this));
698 }
699
700 return _escapedModelProxy;
701 }
702
703 @Override
704 public ExpandoBridge getExpandoBridge() {
705 if (_expandoBridge == null) {
706 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
707 AssetEntry.class.getName(), getPrimaryKey());
708 }
709
710 return _expandoBridge;
711 }
712
713 @Override
714 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
715 getExpandoBridge().setAttributes(serviceContext);
716 }
717
718 @Override
719 public Object clone() {
720 AssetEntryImpl assetEntryImpl = new AssetEntryImpl();
721
722 assetEntryImpl.setEntryId(getEntryId());
723 assetEntryImpl.setGroupId(getGroupId());
724 assetEntryImpl.setCompanyId(getCompanyId());
725 assetEntryImpl.setUserId(getUserId());
726 assetEntryImpl.setUserName(getUserName());
727 assetEntryImpl.setCreateDate(getCreateDate());
728 assetEntryImpl.setModifiedDate(getModifiedDate());
729 assetEntryImpl.setClassNameId(getClassNameId());
730 assetEntryImpl.setClassPK(getClassPK());
731 assetEntryImpl.setClassUuid(getClassUuid());
732 assetEntryImpl.setClassTypeId(getClassTypeId());
733 assetEntryImpl.setVisible(getVisible());
734 assetEntryImpl.setStartDate(getStartDate());
735 assetEntryImpl.setEndDate(getEndDate());
736 assetEntryImpl.setPublishDate(getPublishDate());
737 assetEntryImpl.setExpirationDate(getExpirationDate());
738 assetEntryImpl.setMimeType(getMimeType());
739 assetEntryImpl.setTitle(getTitle());
740 assetEntryImpl.setDescription(getDescription());
741 assetEntryImpl.setSummary(getSummary());
742 assetEntryImpl.setUrl(getUrl());
743 assetEntryImpl.setLayoutUuid(getLayoutUuid());
744 assetEntryImpl.setHeight(getHeight());
745 assetEntryImpl.setWidth(getWidth());
746 assetEntryImpl.setPriority(getPriority());
747 assetEntryImpl.setViewCount(getViewCount());
748
749 assetEntryImpl.resetOriginalValues();
750
751 return assetEntryImpl;
752 }
753
754 public int compareTo(AssetEntry assetEntry) {
755 long primaryKey = assetEntry.getPrimaryKey();
756
757 if (getPrimaryKey() < primaryKey) {
758 return -1;
759 }
760 else if (getPrimaryKey() > primaryKey) {
761 return 1;
762 }
763 else {
764 return 0;
765 }
766 }
767
768 @Override
769 public boolean equals(Object obj) {
770 if (obj == null) {
771 return false;
772 }
773
774 AssetEntry assetEntry = null;
775
776 try {
777 assetEntry = (AssetEntry)obj;
778 }
779 catch (ClassCastException cce) {
780 return false;
781 }
782
783 long primaryKey = assetEntry.getPrimaryKey();
784
785 if (getPrimaryKey() == primaryKey) {
786 return true;
787 }
788 else {
789 return false;
790 }
791 }
792
793 @Override
794 public int hashCode() {
795 return (int)getPrimaryKey();
796 }
797
798 @Override
799 public void resetOriginalValues() {
800 AssetEntryModelImpl assetEntryModelImpl = this;
801
802 assetEntryModelImpl._originalGroupId = assetEntryModelImpl._groupId;
803
804 assetEntryModelImpl._setOriginalGroupId = false;
805
806 assetEntryModelImpl._originalCompanyId = assetEntryModelImpl._companyId;
807
808 assetEntryModelImpl._setOriginalCompanyId = false;
809
810 assetEntryModelImpl._originalClassNameId = assetEntryModelImpl._classNameId;
811
812 assetEntryModelImpl._setOriginalClassNameId = false;
813
814 assetEntryModelImpl._originalClassPK = assetEntryModelImpl._classPK;
815
816 assetEntryModelImpl._setOriginalClassPK = false;
817
818 assetEntryModelImpl._originalClassUuid = assetEntryModelImpl._classUuid;
819
820 assetEntryModelImpl._originalVisible = assetEntryModelImpl._visible;
821
822 assetEntryModelImpl._setOriginalVisible = false;
823
824 assetEntryModelImpl._originalPublishDate = assetEntryModelImpl._publishDate;
825
826 assetEntryModelImpl._originalExpirationDate = assetEntryModelImpl._expirationDate;
827
828 assetEntryModelImpl._columnBitmask = 0;
829 }
830
831 @Override
832 public CacheModel<AssetEntry> toCacheModel() {
833 AssetEntryCacheModel assetEntryCacheModel = new AssetEntryCacheModel();
834
835 assetEntryCacheModel.entryId = getEntryId();
836
837 assetEntryCacheModel.groupId = getGroupId();
838
839 assetEntryCacheModel.companyId = getCompanyId();
840
841 assetEntryCacheModel.userId = getUserId();
842
843 assetEntryCacheModel.userName = getUserName();
844
845 String userName = assetEntryCacheModel.userName;
846
847 if ((userName != null) && (userName.length() == 0)) {
848 assetEntryCacheModel.userName = null;
849 }
850
851 Date createDate = getCreateDate();
852
853 if (createDate != null) {
854 assetEntryCacheModel.createDate = createDate.getTime();
855 }
856 else {
857 assetEntryCacheModel.createDate = Long.MIN_VALUE;
858 }
859
860 Date modifiedDate = getModifiedDate();
861
862 if (modifiedDate != null) {
863 assetEntryCacheModel.modifiedDate = modifiedDate.getTime();
864 }
865 else {
866 assetEntryCacheModel.modifiedDate = Long.MIN_VALUE;
867 }
868
869 assetEntryCacheModel.classNameId = getClassNameId();
870
871 assetEntryCacheModel.classPK = getClassPK();
872
873 assetEntryCacheModel.classUuid = getClassUuid();
874
875 String classUuid = assetEntryCacheModel.classUuid;
876
877 if ((classUuid != null) && (classUuid.length() == 0)) {
878 assetEntryCacheModel.classUuid = null;
879 }
880
881 assetEntryCacheModel.classTypeId = getClassTypeId();
882
883 assetEntryCacheModel.visible = getVisible();
884
885 Date startDate = getStartDate();
886
887 if (startDate != null) {
888 assetEntryCacheModel.startDate = startDate.getTime();
889 }
890 else {
891 assetEntryCacheModel.startDate = Long.MIN_VALUE;
892 }
893
894 Date endDate = getEndDate();
895
896 if (endDate != null) {
897 assetEntryCacheModel.endDate = endDate.getTime();
898 }
899 else {
900 assetEntryCacheModel.endDate = Long.MIN_VALUE;
901 }
902
903 Date publishDate = getPublishDate();
904
905 if (publishDate != null) {
906 assetEntryCacheModel.publishDate = publishDate.getTime();
907 }
908 else {
909 assetEntryCacheModel.publishDate = Long.MIN_VALUE;
910 }
911
912 Date expirationDate = getExpirationDate();
913
914 if (expirationDate != null) {
915 assetEntryCacheModel.expirationDate = expirationDate.getTime();
916 }
917 else {
918 assetEntryCacheModel.expirationDate = Long.MIN_VALUE;
919 }
920
921 assetEntryCacheModel.mimeType = getMimeType();
922
923 String mimeType = assetEntryCacheModel.mimeType;
924
925 if ((mimeType != null) && (mimeType.length() == 0)) {
926 assetEntryCacheModel.mimeType = null;
927 }
928
929 assetEntryCacheModel.title = getTitle();
930
931 String title = assetEntryCacheModel.title;
932
933 if ((title != null) && (title.length() == 0)) {
934 assetEntryCacheModel.title = null;
935 }
936
937 assetEntryCacheModel.description = getDescription();
938
939 String description = assetEntryCacheModel.description;
940
941 if ((description != null) && (description.length() == 0)) {
942 assetEntryCacheModel.description = null;
943 }
944
945 assetEntryCacheModel.summary = getSummary();
946
947 String summary = assetEntryCacheModel.summary;
948
949 if ((summary != null) && (summary.length() == 0)) {
950 assetEntryCacheModel.summary = null;
951 }
952
953 assetEntryCacheModel.url = getUrl();
954
955 String url = assetEntryCacheModel.url;
956
957 if ((url != null) && (url.length() == 0)) {
958 assetEntryCacheModel.url = null;
959 }
960
961 assetEntryCacheModel.layoutUuid = getLayoutUuid();
962
963 String layoutUuid = assetEntryCacheModel.layoutUuid;
964
965 if ((layoutUuid != null) && (layoutUuid.length() == 0)) {
966 assetEntryCacheModel.layoutUuid = null;
967 }
968
969 assetEntryCacheModel.height = getHeight();
970
971 assetEntryCacheModel.width = getWidth();
972
973 assetEntryCacheModel.priority = getPriority();
974
975 assetEntryCacheModel.viewCount = getViewCount();
976
977 return assetEntryCacheModel;
978 }
979
980 @Override
981 public String toString() {
982 StringBundler sb = new StringBundler(53);
983
984 sb.append("{entryId=");
985 sb.append(getEntryId());
986 sb.append(", groupId=");
987 sb.append(getGroupId());
988 sb.append(", companyId=");
989 sb.append(getCompanyId());
990 sb.append(", userId=");
991 sb.append(getUserId());
992 sb.append(", userName=");
993 sb.append(getUserName());
994 sb.append(", createDate=");
995 sb.append(getCreateDate());
996 sb.append(", modifiedDate=");
997 sb.append(getModifiedDate());
998 sb.append(", classNameId=");
999 sb.append(getClassNameId());
1000 sb.append(", classPK=");
1001 sb.append(getClassPK());
1002 sb.append(", classUuid=");
1003 sb.append(getClassUuid());
1004 sb.append(", classTypeId=");
1005 sb.append(getClassTypeId());
1006 sb.append(", visible=");
1007 sb.append(getVisible());
1008 sb.append(", startDate=");
1009 sb.append(getStartDate());
1010 sb.append(", endDate=");
1011 sb.append(getEndDate());
1012 sb.append(", publishDate=");
1013 sb.append(getPublishDate());
1014 sb.append(", expirationDate=");
1015 sb.append(getExpirationDate());
1016 sb.append(", mimeType=");
1017 sb.append(getMimeType());
1018 sb.append(", title=");
1019 sb.append(getTitle());
1020 sb.append(", description=");
1021 sb.append(getDescription());
1022 sb.append(", summary=");
1023 sb.append(getSummary());
1024 sb.append(", url=");
1025 sb.append(getUrl());
1026 sb.append(", layoutUuid=");
1027 sb.append(getLayoutUuid());
1028 sb.append(", height=");
1029 sb.append(getHeight());
1030 sb.append(", width=");
1031 sb.append(getWidth());
1032 sb.append(", priority=");
1033 sb.append(getPriority());
1034 sb.append(", viewCount=");
1035 sb.append(getViewCount());
1036 sb.append("}");
1037
1038 return sb.toString();
1039 }
1040
1041 public String toXmlString() {
1042 StringBundler sb = new StringBundler(82);
1043
1044 sb.append("<model><model-name>");
1045 sb.append("com.liferay.portlet.asset.model.AssetEntry");
1046 sb.append("</model-name>");
1047
1048 sb.append(
1049 "<column><column-name>entryId</column-name><column-value><![CDATA[");
1050 sb.append(getEntryId());
1051 sb.append("]]></column-value></column>");
1052 sb.append(
1053 "<column><column-name>groupId</column-name><column-value><![CDATA[");
1054 sb.append(getGroupId());
1055 sb.append("]]></column-value></column>");
1056 sb.append(
1057 "<column><column-name>companyId</column-name><column-value><![CDATA[");
1058 sb.append(getCompanyId());
1059 sb.append("]]></column-value></column>");
1060 sb.append(
1061 "<column><column-name>userId</column-name><column-value><![CDATA[");
1062 sb.append(getUserId());
1063 sb.append("]]></column-value></column>");
1064 sb.append(
1065 "<column><column-name>userName</column-name><column-value><![CDATA[");
1066 sb.append(getUserName());
1067 sb.append("]]></column-value></column>");
1068 sb.append(
1069 "<column><column-name>createDate</column-name><column-value><![CDATA[");
1070 sb.append(getCreateDate());
1071 sb.append("]]></column-value></column>");
1072 sb.append(
1073 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1074 sb.append(getModifiedDate());
1075 sb.append("]]></column-value></column>");
1076 sb.append(
1077 "<column><column-name>classNameId</column-name><column-value><![CDATA[");
1078 sb.append(getClassNameId());
1079 sb.append("]]></column-value></column>");
1080 sb.append(
1081 "<column><column-name>classPK</column-name><column-value><![CDATA[");
1082 sb.append(getClassPK());
1083 sb.append("]]></column-value></column>");
1084 sb.append(
1085 "<column><column-name>classUuid</column-name><column-value><![CDATA[");
1086 sb.append(getClassUuid());
1087 sb.append("]]></column-value></column>");
1088 sb.append(
1089 "<column><column-name>classTypeId</column-name><column-value><![CDATA[");
1090 sb.append(getClassTypeId());
1091 sb.append("]]></column-value></column>");
1092 sb.append(
1093 "<column><column-name>visible</column-name><column-value><![CDATA[");
1094 sb.append(getVisible());
1095 sb.append("]]></column-value></column>");
1096 sb.append(
1097 "<column><column-name>startDate</column-name><column-value><![CDATA[");
1098 sb.append(getStartDate());
1099 sb.append("]]></column-value></column>");
1100 sb.append(
1101 "<column><column-name>endDate</column-name><column-value><![CDATA[");
1102 sb.append(getEndDate());
1103 sb.append("]]></column-value></column>");
1104 sb.append(
1105 "<column><column-name>publishDate</column-name><column-value><![CDATA[");
1106 sb.append(getPublishDate());
1107 sb.append("]]></column-value></column>");
1108 sb.append(
1109 "<column><column-name>expirationDate</column-name><column-value><![CDATA[");
1110 sb.append(getExpirationDate());
1111 sb.append("]]></column-value></column>");
1112 sb.append(
1113 "<column><column-name>mimeType</column-name><column-value><![CDATA[");
1114 sb.append(getMimeType());
1115 sb.append("]]></column-value></column>");
1116 sb.append(
1117 "<column><column-name>title</column-name><column-value><![CDATA[");
1118 sb.append(getTitle());
1119 sb.append("]]></column-value></column>");
1120 sb.append(
1121 "<column><column-name>description</column-name><column-value><![CDATA[");
1122 sb.append(getDescription());
1123 sb.append("]]></column-value></column>");
1124 sb.append(
1125 "<column><column-name>summary</column-name><column-value><![CDATA[");
1126 sb.append(getSummary());
1127 sb.append("]]></column-value></column>");
1128 sb.append(
1129 "<column><column-name>url</column-name><column-value><![CDATA[");
1130 sb.append(getUrl());
1131 sb.append("]]></column-value></column>");
1132 sb.append(
1133 "<column><column-name>layoutUuid</column-name><column-value><![CDATA[");
1134 sb.append(getLayoutUuid());
1135 sb.append("]]></column-value></column>");
1136 sb.append(
1137 "<column><column-name>height</column-name><column-value><![CDATA[");
1138 sb.append(getHeight());
1139 sb.append("]]></column-value></column>");
1140 sb.append(
1141 "<column><column-name>width</column-name><column-value><![CDATA[");
1142 sb.append(getWidth());
1143 sb.append("]]></column-value></column>");
1144 sb.append(
1145 "<column><column-name>priority</column-name><column-value><![CDATA[");
1146 sb.append(getPriority());
1147 sb.append("]]></column-value></column>");
1148 sb.append(
1149 "<column><column-name>viewCount</column-name><column-value><![CDATA[");
1150 sb.append(getViewCount());
1151 sb.append("]]></column-value></column>");
1152
1153 sb.append("</model>");
1154
1155 return sb.toString();
1156 }
1157
1158 private static ClassLoader _classLoader = AssetEntry.class.getClassLoader();
1159 private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
1160 AssetEntry.class
1161 };
1162 private long _entryId;
1163 private long _groupId;
1164 private long _originalGroupId;
1165 private boolean _setOriginalGroupId;
1166 private long _companyId;
1167 private long _originalCompanyId;
1168 private boolean _setOriginalCompanyId;
1169 private long _userId;
1170 private String _userUuid;
1171 private String _userName;
1172 private Date _createDate;
1173 private Date _modifiedDate;
1174 private long _classNameId;
1175 private long _originalClassNameId;
1176 private boolean _setOriginalClassNameId;
1177 private long _classPK;
1178 private long _originalClassPK;
1179 private boolean _setOriginalClassPK;
1180 private String _classUuid;
1181 private String _originalClassUuid;
1182 private long _classTypeId;
1183 private boolean _visible;
1184 private boolean _originalVisible;
1185 private boolean _setOriginalVisible;
1186 private Date _startDate;
1187 private Date _endDate;
1188 private Date _publishDate;
1189 private Date _originalPublishDate;
1190 private Date _expirationDate;
1191 private Date _originalExpirationDate;
1192 private String _mimeType;
1193 private String _title;
1194 private String _titleCurrentLanguageId;
1195 private String _description;
1196 private String _summary;
1197 private String _url;
1198 private String _layoutUuid;
1199 private int _height;
1200 private int _width;
1201 private double _priority;
1202 private int _viewCount;
1203 private transient ExpandoBridge _expandoBridge;
1204 private long _columnBitmask;
1205 private AssetEntry _escapedModelProxy;
1206 }