001
014
015 package com.liferay.portal.model.impl;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.expando.kernel.model.ExpandoBridge;
020 import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
021
022 import com.liferay.exportimport.kernel.lar.StagedModelType;
023
024 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
025 import com.liferay.portal.kernel.exception.LocaleException;
026 import com.liferay.portal.kernel.exception.PortalException;
027 import com.liferay.portal.kernel.json.JSON;
028 import com.liferay.portal.kernel.model.CacheModel;
029 import com.liferay.portal.kernel.model.LayoutSetPrototype;
030 import com.liferay.portal.kernel.model.LayoutSetPrototypeModel;
031 import com.liferay.portal.kernel.model.LayoutSetPrototypeSoap;
032 import com.liferay.portal.kernel.model.User;
033 import com.liferay.portal.kernel.model.impl.BaseModelImpl;
034 import com.liferay.portal.kernel.service.ServiceContext;
035 import com.liferay.portal.kernel.service.UserLocalServiceUtil;
036 import com.liferay.portal.kernel.util.GetterUtil;
037 import com.liferay.portal.kernel.util.LocaleUtil;
038 import com.liferay.portal.kernel.util.LocalizationUtil;
039 import com.liferay.portal.kernel.util.PortalUtil;
040 import com.liferay.portal.kernel.util.ProxyUtil;
041 import com.liferay.portal.kernel.util.StringBundler;
042 import com.liferay.portal.kernel.util.StringPool;
043 import com.liferay.portal.kernel.util.Validator;
044
045 import java.io.Serializable;
046
047 import java.sql.Types;
048
049 import java.util.ArrayList;
050 import java.util.Date;
051 import java.util.HashMap;
052 import java.util.List;
053 import java.util.Locale;
054 import java.util.Map;
055 import java.util.Set;
056 import java.util.TreeSet;
057
058
071 @JSON(strict = true)
072 @ProviderType
073 public class LayoutSetPrototypeModelImpl extends BaseModelImpl<LayoutSetPrototype>
074 implements LayoutSetPrototypeModel {
075
080 public static final String TABLE_NAME = "LayoutSetPrototype";
081 public static final Object[][] TABLE_COLUMNS = {
082 { "mvccVersion", Types.BIGINT },
083 { "uuid_", Types.VARCHAR },
084 { "layoutSetPrototypeId", Types.BIGINT },
085 { "companyId", Types.BIGINT },
086 { "userId", Types.BIGINT },
087 { "userName", Types.VARCHAR },
088 { "createDate", Types.TIMESTAMP },
089 { "modifiedDate", Types.TIMESTAMP },
090 { "name", Types.VARCHAR },
091 { "description", Types.VARCHAR },
092 { "settings_", Types.VARCHAR },
093 { "active_", Types.BOOLEAN }
094 };
095 public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>();
096
097 static {
098 TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT);
099 TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR);
100 TABLE_COLUMNS_MAP.put("layoutSetPrototypeId", Types.BIGINT);
101 TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
102 TABLE_COLUMNS_MAP.put("userId", Types.BIGINT);
103 TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR);
104 TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP);
105 TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP);
106 TABLE_COLUMNS_MAP.put("name", Types.VARCHAR);
107 TABLE_COLUMNS_MAP.put("description", Types.VARCHAR);
108 TABLE_COLUMNS_MAP.put("settings_", Types.VARCHAR);
109 TABLE_COLUMNS_MAP.put("active_", Types.BOOLEAN);
110 }
111
112 public static final String TABLE_SQL_CREATE = "create table LayoutSetPrototype (mvccVersion LONG default 0 not null,uuid_ VARCHAR(75) null,layoutSetPrototypeId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,name STRING null,description STRING null,settings_ STRING null,active_ BOOLEAN)";
113 public static final String TABLE_SQL_DROP = "drop table LayoutSetPrototype";
114 public static final String ORDER_BY_JPQL = " ORDER BY layoutSetPrototype.layoutSetPrototypeId ASC";
115 public static final String ORDER_BY_SQL = " ORDER BY LayoutSetPrototype.layoutSetPrototypeId ASC";
116 public static final String DATA_SOURCE = "liferayDataSource";
117 public static final String SESSION_FACTORY = "liferaySessionFactory";
118 public static final String TX_MANAGER = "liferayTransactionManager";
119 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
120 "value.object.entity.cache.enabled.com.liferay.portal.kernel.model.LayoutSetPrototype"),
121 true);
122 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
123 "value.object.finder.cache.enabled.com.liferay.portal.kernel.model.LayoutSetPrototype"),
124 true);
125 public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
126 "value.object.column.bitmask.enabled.com.liferay.portal.kernel.model.LayoutSetPrototype"),
127 true);
128 public static final long ACTIVE_COLUMN_BITMASK = 1L;
129 public static final long COMPANYID_COLUMN_BITMASK = 2L;
130 public static final long UUID_COLUMN_BITMASK = 4L;
131 public static final long LAYOUTSETPROTOTYPEID_COLUMN_BITMASK = 8L;
132
133
139 public static LayoutSetPrototype toModel(LayoutSetPrototypeSoap soapModel) {
140 if (soapModel == null) {
141 return null;
142 }
143
144 LayoutSetPrototype model = new LayoutSetPrototypeImpl();
145
146 model.setMvccVersion(soapModel.getMvccVersion());
147 model.setUuid(soapModel.getUuid());
148 model.setLayoutSetPrototypeId(soapModel.getLayoutSetPrototypeId());
149 model.setCompanyId(soapModel.getCompanyId());
150 model.setUserId(soapModel.getUserId());
151 model.setUserName(soapModel.getUserName());
152 model.setCreateDate(soapModel.getCreateDate());
153 model.setModifiedDate(soapModel.getModifiedDate());
154 model.setName(soapModel.getName());
155 model.setDescription(soapModel.getDescription());
156 model.setSettings(soapModel.getSettings());
157 model.setActive(soapModel.getActive());
158
159 return model;
160 }
161
162
168 public static List<LayoutSetPrototype> toModels(
169 LayoutSetPrototypeSoap[] soapModels) {
170 if (soapModels == null) {
171 return null;
172 }
173
174 List<LayoutSetPrototype> models = new ArrayList<LayoutSetPrototype>(soapModels.length);
175
176 for (LayoutSetPrototypeSoap soapModel : soapModels) {
177 models.add(toModel(soapModel));
178 }
179
180 return models;
181 }
182
183 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
184 "lock.expiration.time.com.liferay.portal.kernel.model.LayoutSetPrototype"));
185
186 public LayoutSetPrototypeModelImpl() {
187 }
188
189 @Override
190 public long getPrimaryKey() {
191 return _layoutSetPrototypeId;
192 }
193
194 @Override
195 public void setPrimaryKey(long primaryKey) {
196 setLayoutSetPrototypeId(primaryKey);
197 }
198
199 @Override
200 public Serializable getPrimaryKeyObj() {
201 return _layoutSetPrototypeId;
202 }
203
204 @Override
205 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
206 setPrimaryKey(((Long)primaryKeyObj).longValue());
207 }
208
209 @Override
210 public Class<?> getModelClass() {
211 return LayoutSetPrototype.class;
212 }
213
214 @Override
215 public String getModelClassName() {
216 return LayoutSetPrototype.class.getName();
217 }
218
219 @Override
220 public Map<String, Object> getModelAttributes() {
221 Map<String, Object> attributes = new HashMap<String, Object>();
222
223 attributes.put("mvccVersion", getMvccVersion());
224 attributes.put("uuid", getUuid());
225 attributes.put("layoutSetPrototypeId", getLayoutSetPrototypeId());
226 attributes.put("companyId", getCompanyId());
227 attributes.put("userId", getUserId());
228 attributes.put("userName", getUserName());
229 attributes.put("createDate", getCreateDate());
230 attributes.put("modifiedDate", getModifiedDate());
231 attributes.put("name", getName());
232 attributes.put("description", getDescription());
233 attributes.put("settings", getSettings());
234 attributes.put("active", getActive());
235
236 attributes.put("entityCacheEnabled", isEntityCacheEnabled());
237 attributes.put("finderCacheEnabled", isFinderCacheEnabled());
238
239 return attributes;
240 }
241
242 @Override
243 public void setModelAttributes(Map<String, Object> attributes) {
244 Long mvccVersion = (Long)attributes.get("mvccVersion");
245
246 if (mvccVersion != null) {
247 setMvccVersion(mvccVersion);
248 }
249
250 String uuid = (String)attributes.get("uuid");
251
252 if (uuid != null) {
253 setUuid(uuid);
254 }
255
256 Long layoutSetPrototypeId = (Long)attributes.get("layoutSetPrototypeId");
257
258 if (layoutSetPrototypeId != null) {
259 setLayoutSetPrototypeId(layoutSetPrototypeId);
260 }
261
262 Long companyId = (Long)attributes.get("companyId");
263
264 if (companyId != null) {
265 setCompanyId(companyId);
266 }
267
268 Long userId = (Long)attributes.get("userId");
269
270 if (userId != null) {
271 setUserId(userId);
272 }
273
274 String userName = (String)attributes.get("userName");
275
276 if (userName != null) {
277 setUserName(userName);
278 }
279
280 Date createDate = (Date)attributes.get("createDate");
281
282 if (createDate != null) {
283 setCreateDate(createDate);
284 }
285
286 Date modifiedDate = (Date)attributes.get("modifiedDate");
287
288 if (modifiedDate != null) {
289 setModifiedDate(modifiedDate);
290 }
291
292 String name = (String)attributes.get("name");
293
294 if (name != null) {
295 setName(name);
296 }
297
298 String description = (String)attributes.get("description");
299
300 if (description != null) {
301 setDescription(description);
302 }
303
304 String settings = (String)attributes.get("settings");
305
306 if (settings != null) {
307 setSettings(settings);
308 }
309
310 Boolean active = (Boolean)attributes.get("active");
311
312 if (active != null) {
313 setActive(active);
314 }
315 }
316
317 @JSON
318 @Override
319 public long getMvccVersion() {
320 return _mvccVersion;
321 }
322
323 @Override
324 public void setMvccVersion(long mvccVersion) {
325 _mvccVersion = mvccVersion;
326 }
327
328 @JSON
329 @Override
330 public String getUuid() {
331 if (_uuid == null) {
332 return StringPool.BLANK;
333 }
334 else {
335 return _uuid;
336 }
337 }
338
339 @Override
340 public void setUuid(String uuid) {
341 if (_originalUuid == null) {
342 _originalUuid = _uuid;
343 }
344
345 _uuid = uuid;
346 }
347
348 public String getOriginalUuid() {
349 return GetterUtil.getString(_originalUuid);
350 }
351
352 @JSON
353 @Override
354 public long getLayoutSetPrototypeId() {
355 return _layoutSetPrototypeId;
356 }
357
358 @Override
359 public void setLayoutSetPrototypeId(long layoutSetPrototypeId) {
360 _layoutSetPrototypeId = layoutSetPrototypeId;
361 }
362
363 @JSON
364 @Override
365 public long getCompanyId() {
366 return _companyId;
367 }
368
369 @Override
370 public void setCompanyId(long companyId) {
371 _columnBitmask |= COMPANYID_COLUMN_BITMASK;
372
373 if (!_setOriginalCompanyId) {
374 _setOriginalCompanyId = true;
375
376 _originalCompanyId = _companyId;
377 }
378
379 _companyId = companyId;
380 }
381
382 public long getOriginalCompanyId() {
383 return _originalCompanyId;
384 }
385
386 @JSON
387 @Override
388 public long getUserId() {
389 return _userId;
390 }
391
392 @Override
393 public void setUserId(long userId) {
394 _userId = userId;
395 }
396
397 @Override
398 public String getUserUuid() {
399 try {
400 User user = UserLocalServiceUtil.getUserById(getUserId());
401
402 return user.getUuid();
403 }
404 catch (PortalException pe) {
405 return StringPool.BLANK;
406 }
407 }
408
409 @Override
410 public void setUserUuid(String userUuid) {
411 }
412
413 @JSON
414 @Override
415 public String getUserName() {
416 if (_userName == null) {
417 return StringPool.BLANK;
418 }
419 else {
420 return _userName;
421 }
422 }
423
424 @Override
425 public void setUserName(String userName) {
426 _userName = userName;
427 }
428
429 @JSON
430 @Override
431 public Date getCreateDate() {
432 return _createDate;
433 }
434
435 @Override
436 public void setCreateDate(Date createDate) {
437 _createDate = createDate;
438 }
439
440 @JSON
441 @Override
442 public Date getModifiedDate() {
443 return _modifiedDate;
444 }
445
446 public boolean hasSetModifiedDate() {
447 return _setModifiedDate;
448 }
449
450 @Override
451 public void setModifiedDate(Date modifiedDate) {
452 _setModifiedDate = true;
453
454 _modifiedDate = modifiedDate;
455 }
456
457 @JSON
458 @Override
459 public String getName() {
460 if (_name == null) {
461 return StringPool.BLANK;
462 }
463 else {
464 return _name;
465 }
466 }
467
468 @Override
469 public String getName(Locale locale) {
470 String languageId = LocaleUtil.toLanguageId(locale);
471
472 return getName(languageId);
473 }
474
475 @Override
476 public String getName(Locale locale, boolean useDefault) {
477 String languageId = LocaleUtil.toLanguageId(locale);
478
479 return getName(languageId, useDefault);
480 }
481
482 @Override
483 public String getName(String languageId) {
484 return LocalizationUtil.getLocalization(getName(), languageId);
485 }
486
487 @Override
488 public String getName(String languageId, boolean useDefault) {
489 return LocalizationUtil.getLocalization(getName(), languageId,
490 useDefault);
491 }
492
493 @Override
494 public String getNameCurrentLanguageId() {
495 return _nameCurrentLanguageId;
496 }
497
498 @JSON
499 @Override
500 public String getNameCurrentValue() {
501 Locale locale = getLocale(_nameCurrentLanguageId);
502
503 return getName(locale);
504 }
505
506 @Override
507 public Map<Locale, String> getNameMap() {
508 return LocalizationUtil.getLocalizationMap(getName());
509 }
510
511 @Override
512 public void setName(String name) {
513 _name = name;
514 }
515
516 @Override
517 public void setName(String name, Locale locale) {
518 setName(name, locale, LocaleUtil.getDefault());
519 }
520
521 @Override
522 public void setName(String name, Locale locale, Locale defaultLocale) {
523 String languageId = LocaleUtil.toLanguageId(locale);
524 String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
525
526 if (Validator.isNotNull(name)) {
527 setName(LocalizationUtil.updateLocalization(getName(), "Name",
528 name, languageId, defaultLanguageId));
529 }
530 else {
531 setName(LocalizationUtil.removeLocalization(getName(), "Name",
532 languageId));
533 }
534 }
535
536 @Override
537 public void setNameCurrentLanguageId(String languageId) {
538 _nameCurrentLanguageId = languageId;
539 }
540
541 @Override
542 public void setNameMap(Map<Locale, String> nameMap) {
543 setNameMap(nameMap, LocaleUtil.getDefault());
544 }
545
546 @Override
547 public void setNameMap(Map<Locale, String> nameMap, Locale defaultLocale) {
548 if (nameMap == null) {
549 return;
550 }
551
552 setName(LocalizationUtil.updateLocalization(nameMap, getName(), "Name",
553 LocaleUtil.toLanguageId(defaultLocale)));
554 }
555
556 @JSON
557 @Override
558 public String getDescription() {
559 if (_description == null) {
560 return StringPool.BLANK;
561 }
562 else {
563 return _description;
564 }
565 }
566
567 @Override
568 public String getDescription(Locale locale) {
569 String languageId = LocaleUtil.toLanguageId(locale);
570
571 return getDescription(languageId);
572 }
573
574 @Override
575 public String getDescription(Locale locale, boolean useDefault) {
576 String languageId = LocaleUtil.toLanguageId(locale);
577
578 return getDescription(languageId, useDefault);
579 }
580
581 @Override
582 public String getDescription(String languageId) {
583 return LocalizationUtil.getLocalization(getDescription(), languageId);
584 }
585
586 @Override
587 public String getDescription(String languageId, boolean useDefault) {
588 return LocalizationUtil.getLocalization(getDescription(), languageId,
589 useDefault);
590 }
591
592 @Override
593 public String getDescriptionCurrentLanguageId() {
594 return _descriptionCurrentLanguageId;
595 }
596
597 @JSON
598 @Override
599 public String getDescriptionCurrentValue() {
600 Locale locale = getLocale(_descriptionCurrentLanguageId);
601
602 return getDescription(locale);
603 }
604
605 @Override
606 public Map<Locale, String> getDescriptionMap() {
607 return LocalizationUtil.getLocalizationMap(getDescription());
608 }
609
610 @Override
611 public void setDescription(String description) {
612 _description = description;
613 }
614
615 @Override
616 public void setDescription(String description, Locale locale) {
617 setDescription(description, locale, LocaleUtil.getDefault());
618 }
619
620 @Override
621 public void setDescription(String description, Locale locale,
622 Locale defaultLocale) {
623 String languageId = LocaleUtil.toLanguageId(locale);
624 String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
625
626 if (Validator.isNotNull(description)) {
627 setDescription(LocalizationUtil.updateLocalization(
628 getDescription(), "Description", description, languageId,
629 defaultLanguageId));
630 }
631 else {
632 setDescription(LocalizationUtil.removeLocalization(
633 getDescription(), "Description", languageId));
634 }
635 }
636
637 @Override
638 public void setDescriptionCurrentLanguageId(String languageId) {
639 _descriptionCurrentLanguageId = languageId;
640 }
641
642 @Override
643 public void setDescriptionMap(Map<Locale, String> descriptionMap) {
644 setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
645 }
646
647 @Override
648 public void setDescriptionMap(Map<Locale, String> descriptionMap,
649 Locale defaultLocale) {
650 if (descriptionMap == null) {
651 return;
652 }
653
654 setDescription(LocalizationUtil.updateLocalization(descriptionMap,
655 getDescription(), "Description",
656 LocaleUtil.toLanguageId(defaultLocale)));
657 }
658
659 @JSON
660 @Override
661 public String getSettings() {
662 if (_settings == null) {
663 return StringPool.BLANK;
664 }
665 else {
666 return _settings;
667 }
668 }
669
670 @Override
671 public void setSettings(String settings) {
672 _settings = settings;
673 }
674
675 @JSON
676 @Override
677 public boolean getActive() {
678 return _active;
679 }
680
681 @Override
682 public boolean isActive() {
683 return _active;
684 }
685
686 @Override
687 public void setActive(boolean active) {
688 _columnBitmask |= ACTIVE_COLUMN_BITMASK;
689
690 if (!_setOriginalActive) {
691 _setOriginalActive = true;
692
693 _originalActive = _active;
694 }
695
696 _active = active;
697 }
698
699 public boolean getOriginalActive() {
700 return _originalActive;
701 }
702
703 @Override
704 public StagedModelType getStagedModelType() {
705 return new StagedModelType(PortalUtil.getClassNameId(
706 LayoutSetPrototype.class.getName()));
707 }
708
709 public long getColumnBitmask() {
710 return _columnBitmask;
711 }
712
713 @Override
714 public ExpandoBridge getExpandoBridge() {
715 return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
716 LayoutSetPrototype.class.getName(), getPrimaryKey());
717 }
718
719 @Override
720 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
721 ExpandoBridge expandoBridge = getExpandoBridge();
722
723 expandoBridge.setAttributes(serviceContext);
724 }
725
726 @Override
727 public String[] getAvailableLanguageIds() {
728 Set<String> availableLanguageIds = new TreeSet<String>();
729
730 Map<Locale, String> nameMap = getNameMap();
731
732 for (Map.Entry<Locale, String> entry : nameMap.entrySet()) {
733 Locale locale = entry.getKey();
734 String value = entry.getValue();
735
736 if (Validator.isNotNull(value)) {
737 availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
738 }
739 }
740
741 Map<Locale, String> descriptionMap = getDescriptionMap();
742
743 for (Map.Entry<Locale, String> entry : descriptionMap.entrySet()) {
744 Locale locale = entry.getKey();
745 String value = entry.getValue();
746
747 if (Validator.isNotNull(value)) {
748 availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
749 }
750 }
751
752 return availableLanguageIds.toArray(new String[availableLanguageIds.size()]);
753 }
754
755 @Override
756 public String getDefaultLanguageId() {
757 String xml = getName();
758
759 if (xml == null) {
760 return StringPool.BLANK;
761 }
762
763 Locale defaultLocale = LocaleUtil.getDefault();
764
765 return LocalizationUtil.getDefaultLanguageId(xml, defaultLocale);
766 }
767
768 @Override
769 public void prepareLocalizedFieldsForImport() throws LocaleException {
770 Locale defaultLocale = LocaleUtil.fromLanguageId(getDefaultLanguageId());
771
772 Locale[] availableLocales = LocaleUtil.fromLanguageIds(getAvailableLanguageIds());
773
774 Locale defaultImportLocale = LocalizationUtil.getDefaultImportLocale(LayoutSetPrototype.class.getName(),
775 getPrimaryKey(), defaultLocale, availableLocales);
776
777 prepareLocalizedFieldsForImport(defaultImportLocale);
778 }
779
780 @Override
781 @SuppressWarnings("unused")
782 public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
783 throws LocaleException {
784 Locale defaultLocale = LocaleUtil.getDefault();
785
786 String modelDefaultLanguageId = getDefaultLanguageId();
787
788 String name = getName(defaultLocale);
789
790 if (Validator.isNull(name)) {
791 setName(getName(modelDefaultLanguageId), defaultLocale);
792 }
793 else {
794 setName(getName(defaultLocale), defaultLocale, defaultLocale);
795 }
796
797 String description = getDescription(defaultLocale);
798
799 if (Validator.isNull(description)) {
800 setDescription(getDescription(modelDefaultLanguageId), defaultLocale);
801 }
802 else {
803 setDescription(getDescription(defaultLocale), defaultLocale,
804 defaultLocale);
805 }
806 }
807
808 @Override
809 public LayoutSetPrototype toEscapedModel() {
810 if (_escapedModel == null) {
811 _escapedModel = (LayoutSetPrototype)ProxyUtil.newProxyInstance(_classLoader,
812 _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
813 }
814
815 return _escapedModel;
816 }
817
818 @Override
819 public Object clone() {
820 LayoutSetPrototypeImpl layoutSetPrototypeImpl = new LayoutSetPrototypeImpl();
821
822 layoutSetPrototypeImpl.setMvccVersion(getMvccVersion());
823 layoutSetPrototypeImpl.setUuid(getUuid());
824 layoutSetPrototypeImpl.setLayoutSetPrototypeId(getLayoutSetPrototypeId());
825 layoutSetPrototypeImpl.setCompanyId(getCompanyId());
826 layoutSetPrototypeImpl.setUserId(getUserId());
827 layoutSetPrototypeImpl.setUserName(getUserName());
828 layoutSetPrototypeImpl.setCreateDate(getCreateDate());
829 layoutSetPrototypeImpl.setModifiedDate(getModifiedDate());
830 layoutSetPrototypeImpl.setName(getName());
831 layoutSetPrototypeImpl.setDescription(getDescription());
832 layoutSetPrototypeImpl.setSettings(getSettings());
833 layoutSetPrototypeImpl.setActive(getActive());
834
835 layoutSetPrototypeImpl.resetOriginalValues();
836
837 return layoutSetPrototypeImpl;
838 }
839
840 @Override
841 public int compareTo(LayoutSetPrototype layoutSetPrototype) {
842 long primaryKey = layoutSetPrototype.getPrimaryKey();
843
844 if (getPrimaryKey() < primaryKey) {
845 return -1;
846 }
847 else if (getPrimaryKey() > primaryKey) {
848 return 1;
849 }
850 else {
851 return 0;
852 }
853 }
854
855 @Override
856 public boolean equals(Object obj) {
857 if (this == obj) {
858 return true;
859 }
860
861 if (!(obj instanceof LayoutSetPrototype)) {
862 return false;
863 }
864
865 LayoutSetPrototype layoutSetPrototype = (LayoutSetPrototype)obj;
866
867 long primaryKey = layoutSetPrototype.getPrimaryKey();
868
869 if (getPrimaryKey() == primaryKey) {
870 return true;
871 }
872 else {
873 return false;
874 }
875 }
876
877 @Override
878 public int hashCode() {
879 return (int)getPrimaryKey();
880 }
881
882 @Override
883 public boolean isEntityCacheEnabled() {
884 return ENTITY_CACHE_ENABLED;
885 }
886
887 @Override
888 public boolean isFinderCacheEnabled() {
889 return FINDER_CACHE_ENABLED;
890 }
891
892 @Override
893 public void resetOriginalValues() {
894 LayoutSetPrototypeModelImpl layoutSetPrototypeModelImpl = this;
895
896 layoutSetPrototypeModelImpl._originalUuid = layoutSetPrototypeModelImpl._uuid;
897
898 layoutSetPrototypeModelImpl._originalCompanyId = layoutSetPrototypeModelImpl._companyId;
899
900 layoutSetPrototypeModelImpl._setOriginalCompanyId = false;
901
902 layoutSetPrototypeModelImpl._setModifiedDate = false;
903
904 layoutSetPrototypeModelImpl._originalActive = layoutSetPrototypeModelImpl._active;
905
906 layoutSetPrototypeModelImpl._setOriginalActive = false;
907
908 layoutSetPrototypeModelImpl._columnBitmask = 0;
909 }
910
911 @Override
912 public CacheModel<LayoutSetPrototype> toCacheModel() {
913 LayoutSetPrototypeCacheModel layoutSetPrototypeCacheModel = new LayoutSetPrototypeCacheModel();
914
915 layoutSetPrototypeCacheModel.mvccVersion = getMvccVersion();
916
917 layoutSetPrototypeCacheModel.uuid = getUuid();
918
919 String uuid = layoutSetPrototypeCacheModel.uuid;
920
921 if ((uuid != null) && (uuid.length() == 0)) {
922 layoutSetPrototypeCacheModel.uuid = null;
923 }
924
925 layoutSetPrototypeCacheModel.layoutSetPrototypeId = getLayoutSetPrototypeId();
926
927 layoutSetPrototypeCacheModel.companyId = getCompanyId();
928
929 layoutSetPrototypeCacheModel.userId = getUserId();
930
931 layoutSetPrototypeCacheModel.userName = getUserName();
932
933 String userName = layoutSetPrototypeCacheModel.userName;
934
935 if ((userName != null) && (userName.length() == 0)) {
936 layoutSetPrototypeCacheModel.userName = null;
937 }
938
939 Date createDate = getCreateDate();
940
941 if (createDate != null) {
942 layoutSetPrototypeCacheModel.createDate = createDate.getTime();
943 }
944 else {
945 layoutSetPrototypeCacheModel.createDate = Long.MIN_VALUE;
946 }
947
948 Date modifiedDate = getModifiedDate();
949
950 if (modifiedDate != null) {
951 layoutSetPrototypeCacheModel.modifiedDate = modifiedDate.getTime();
952 }
953 else {
954 layoutSetPrototypeCacheModel.modifiedDate = Long.MIN_VALUE;
955 }
956
957 layoutSetPrototypeCacheModel.name = getName();
958
959 String name = layoutSetPrototypeCacheModel.name;
960
961 if ((name != null) && (name.length() == 0)) {
962 layoutSetPrototypeCacheModel.name = null;
963 }
964
965 layoutSetPrototypeCacheModel.description = getDescription();
966
967 String description = layoutSetPrototypeCacheModel.description;
968
969 if ((description != null) && (description.length() == 0)) {
970 layoutSetPrototypeCacheModel.description = null;
971 }
972
973 layoutSetPrototypeCacheModel.settings = getSettings();
974
975 String settings = layoutSetPrototypeCacheModel.settings;
976
977 if ((settings != null) && (settings.length() == 0)) {
978 layoutSetPrototypeCacheModel.settings = null;
979 }
980
981 layoutSetPrototypeCacheModel.active = getActive();
982
983 return layoutSetPrototypeCacheModel;
984 }
985
986 @Override
987 public String toString() {
988 StringBundler sb = new StringBundler(25);
989
990 sb.append("{mvccVersion=");
991 sb.append(getMvccVersion());
992 sb.append(", uuid=");
993 sb.append(getUuid());
994 sb.append(", layoutSetPrototypeId=");
995 sb.append(getLayoutSetPrototypeId());
996 sb.append(", companyId=");
997 sb.append(getCompanyId());
998 sb.append(", userId=");
999 sb.append(getUserId());
1000 sb.append(", userName=");
1001 sb.append(getUserName());
1002 sb.append(", createDate=");
1003 sb.append(getCreateDate());
1004 sb.append(", modifiedDate=");
1005 sb.append(getModifiedDate());
1006 sb.append(", name=");
1007 sb.append(getName());
1008 sb.append(", description=");
1009 sb.append(getDescription());
1010 sb.append(", settings=");
1011 sb.append(getSettings());
1012 sb.append(", active=");
1013 sb.append(getActive());
1014 sb.append("}");
1015
1016 return sb.toString();
1017 }
1018
1019 @Override
1020 public String toXmlString() {
1021 StringBundler sb = new StringBundler(40);
1022
1023 sb.append("<model><model-name>");
1024 sb.append("com.liferay.portal.kernel.model.LayoutSetPrototype");
1025 sb.append("</model-name>");
1026
1027 sb.append(
1028 "<column><column-name>mvccVersion</column-name><column-value><![CDATA[");
1029 sb.append(getMvccVersion());
1030 sb.append("]]></column-value></column>");
1031 sb.append(
1032 "<column><column-name>uuid</column-name><column-value><![CDATA[");
1033 sb.append(getUuid());
1034 sb.append("]]></column-value></column>");
1035 sb.append(
1036 "<column><column-name>layoutSetPrototypeId</column-name><column-value><![CDATA[");
1037 sb.append(getLayoutSetPrototypeId());
1038 sb.append("]]></column-value></column>");
1039 sb.append(
1040 "<column><column-name>companyId</column-name><column-value><![CDATA[");
1041 sb.append(getCompanyId());
1042 sb.append("]]></column-value></column>");
1043 sb.append(
1044 "<column><column-name>userId</column-name><column-value><![CDATA[");
1045 sb.append(getUserId());
1046 sb.append("]]></column-value></column>");
1047 sb.append(
1048 "<column><column-name>userName</column-name><column-value><![CDATA[");
1049 sb.append(getUserName());
1050 sb.append("]]></column-value></column>");
1051 sb.append(
1052 "<column><column-name>createDate</column-name><column-value><![CDATA[");
1053 sb.append(getCreateDate());
1054 sb.append("]]></column-value></column>");
1055 sb.append(
1056 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1057 sb.append(getModifiedDate());
1058 sb.append("]]></column-value></column>");
1059 sb.append(
1060 "<column><column-name>name</column-name><column-value><![CDATA[");
1061 sb.append(getName());
1062 sb.append("]]></column-value></column>");
1063 sb.append(
1064 "<column><column-name>description</column-name><column-value><![CDATA[");
1065 sb.append(getDescription());
1066 sb.append("]]></column-value></column>");
1067 sb.append(
1068 "<column><column-name>settings</column-name><column-value><![CDATA[");
1069 sb.append(getSettings());
1070 sb.append("]]></column-value></column>");
1071 sb.append(
1072 "<column><column-name>active</column-name><column-value><![CDATA[");
1073 sb.append(getActive());
1074 sb.append("]]></column-value></column>");
1075
1076 sb.append("</model>");
1077
1078 return sb.toString();
1079 }
1080
1081 private static final ClassLoader _classLoader = LayoutSetPrototype.class.getClassLoader();
1082 private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1083 LayoutSetPrototype.class
1084 };
1085 private long _mvccVersion;
1086 private String _uuid;
1087 private String _originalUuid;
1088 private long _layoutSetPrototypeId;
1089 private long _companyId;
1090 private long _originalCompanyId;
1091 private boolean _setOriginalCompanyId;
1092 private long _userId;
1093 private String _userName;
1094 private Date _createDate;
1095 private Date _modifiedDate;
1096 private boolean _setModifiedDate;
1097 private String _name;
1098 private String _nameCurrentLanguageId;
1099 private String _description;
1100 private String _descriptionCurrentLanguageId;
1101 private String _settings;
1102 private boolean _active;
1103 private boolean _originalActive;
1104 private boolean _setOriginalActive;
1105 private long _columnBitmask;
1106 private LayoutSetPrototype _escapedModel;
1107 }