001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.LocaleException;
018    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.json.JSON;
021    import com.liferay.portal.kernel.lar.StagedModelType;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.LocaleUtil;
024    import com.liferay.portal.kernel.util.LocalizationUtil;
025    import com.liferay.portal.kernel.util.ProxyUtil;
026    import com.liferay.portal.kernel.util.StringBundler;
027    import com.liferay.portal.kernel.util.StringPool;
028    import com.liferay.portal.kernel.util.Validator;
029    import com.liferay.portal.model.CacheModel;
030    import com.liferay.portal.model.LayoutPrototype;
031    import com.liferay.portal.model.LayoutPrototypeModel;
032    import com.liferay.portal.model.LayoutPrototypeSoap;
033    import com.liferay.portal.service.ServiceContext;
034    import com.liferay.portal.util.PortalUtil;
035    
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.HashMap;
046    import java.util.List;
047    import java.util.Locale;
048    import java.util.Map;
049    import java.util.Set;
050    import java.util.TreeSet;
051    
052    /**
053     * The base model implementation for the LayoutPrototype service. Represents a row in the "LayoutPrototype" database table, with each column mapped to a property of this class.
054     *
055     * <p>
056     * This implementation and its corresponding interface {@link com.liferay.portal.model.LayoutPrototypeModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LayoutPrototypeImpl}.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see LayoutPrototypeImpl
061     * @see com.liferay.portal.model.LayoutPrototype
062     * @see com.liferay.portal.model.LayoutPrototypeModel
063     * @generated
064     */
065    @JSON(strict = true)
066    public class LayoutPrototypeModelImpl extends BaseModelImpl<LayoutPrototype>
067            implements LayoutPrototypeModel {
068            /*
069             * NOTE FOR DEVELOPERS:
070             *
071             * Never modify or reference this class directly. All methods that expect a layout prototype model instance should use the {@link com.liferay.portal.model.LayoutPrototype} interface instead.
072             */
073            public static final String TABLE_NAME = "LayoutPrototype";
074            public static final Object[][] TABLE_COLUMNS = {
075                            { "uuid_", Types.VARCHAR },
076                            { "layoutPrototypeId", Types.BIGINT },
077                            { "companyId", Types.BIGINT },
078                            { "userId", Types.BIGINT },
079                            { "userName", Types.VARCHAR },
080                            { "createDate", Types.TIMESTAMP },
081                            { "modifiedDate", Types.TIMESTAMP },
082                            { "name", Types.VARCHAR },
083                            { "description", Types.VARCHAR },
084                            { "settings_", Types.VARCHAR },
085                            { "active_", Types.BOOLEAN }
086                    };
087            public static final String TABLE_SQL_CREATE = "create table LayoutPrototype (uuid_ VARCHAR(75) null,layoutPrototypeId 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)";
088            public static final String TABLE_SQL_DROP = "drop table LayoutPrototype";
089            public static final String ORDER_BY_JPQL = " ORDER BY layoutPrototype.layoutPrototypeId ASC";
090            public static final String ORDER_BY_SQL = " ORDER BY LayoutPrototype.layoutPrototypeId ASC";
091            public static final String DATA_SOURCE = "liferayDataSource";
092            public static final String SESSION_FACTORY = "liferaySessionFactory";
093            public static final String TX_MANAGER = "liferayTransactionManager";
094            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
095                                    "value.object.entity.cache.enabled.com.liferay.portal.model.LayoutPrototype"),
096                            true);
097            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
098                                    "value.object.finder.cache.enabled.com.liferay.portal.model.LayoutPrototype"),
099                            true);
100            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
101                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.LayoutPrototype"),
102                            true);
103            public static long ACTIVE_COLUMN_BITMASK = 1L;
104            public static long COMPANYID_COLUMN_BITMASK = 2L;
105            public static long UUID_COLUMN_BITMASK = 4L;
106            public static long LAYOUTPROTOTYPEID_COLUMN_BITMASK = 8L;
107    
108            /**
109             * Converts the soap model instance into a normal model instance.
110             *
111             * @param soapModel the soap model instance to convert
112             * @return the normal model instance
113             */
114            public static LayoutPrototype toModel(LayoutPrototypeSoap soapModel) {
115                    if (soapModel == null) {
116                            return null;
117                    }
118    
119                    LayoutPrototype model = new LayoutPrototypeImpl();
120    
121                    model.setUuid(soapModel.getUuid());
122                    model.setLayoutPrototypeId(soapModel.getLayoutPrototypeId());
123                    model.setCompanyId(soapModel.getCompanyId());
124                    model.setUserId(soapModel.getUserId());
125                    model.setUserName(soapModel.getUserName());
126                    model.setCreateDate(soapModel.getCreateDate());
127                    model.setModifiedDate(soapModel.getModifiedDate());
128                    model.setName(soapModel.getName());
129                    model.setDescription(soapModel.getDescription());
130                    model.setSettings(soapModel.getSettings());
131                    model.setActive(soapModel.getActive());
132    
133                    return model;
134            }
135    
136            /**
137             * Converts the soap model instances into normal model instances.
138             *
139             * @param soapModels the soap model instances to convert
140             * @return the normal model instances
141             */
142            public static List<LayoutPrototype> toModels(
143                    LayoutPrototypeSoap[] soapModels) {
144                    if (soapModels == null) {
145                            return null;
146                    }
147    
148                    List<LayoutPrototype> models = new ArrayList<LayoutPrototype>(soapModels.length);
149    
150                    for (LayoutPrototypeSoap soapModel : soapModels) {
151                            models.add(toModel(soapModel));
152                    }
153    
154                    return models;
155            }
156    
157            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
158                                    "lock.expiration.time.com.liferay.portal.model.LayoutPrototype"));
159    
160            public LayoutPrototypeModelImpl() {
161            }
162    
163            @Override
164            public long getPrimaryKey() {
165                    return _layoutPrototypeId;
166            }
167    
168            @Override
169            public void setPrimaryKey(long primaryKey) {
170                    setLayoutPrototypeId(primaryKey);
171            }
172    
173            @Override
174            public Serializable getPrimaryKeyObj() {
175                    return _layoutPrototypeId;
176            }
177    
178            @Override
179            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
180                    setPrimaryKey(((Long)primaryKeyObj).longValue());
181            }
182    
183            @Override
184            public Class<?> getModelClass() {
185                    return LayoutPrototype.class;
186            }
187    
188            @Override
189            public String getModelClassName() {
190                    return LayoutPrototype.class.getName();
191            }
192    
193            @Override
194            public Map<String, Object> getModelAttributes() {
195                    Map<String, Object> attributes = new HashMap<String, Object>();
196    
197                    attributes.put("uuid", getUuid());
198                    attributes.put("layoutPrototypeId", getLayoutPrototypeId());
199                    attributes.put("companyId", getCompanyId());
200                    attributes.put("userId", getUserId());
201                    attributes.put("userName", getUserName());
202                    attributes.put("createDate", getCreateDate());
203                    attributes.put("modifiedDate", getModifiedDate());
204                    attributes.put("name", getName());
205                    attributes.put("description", getDescription());
206                    attributes.put("settings", getSettings());
207                    attributes.put("active", getActive());
208    
209                    return attributes;
210            }
211    
212            @Override
213            public void setModelAttributes(Map<String, Object> attributes) {
214                    String uuid = (String)attributes.get("uuid");
215    
216                    if (uuid != null) {
217                            setUuid(uuid);
218                    }
219    
220                    Long layoutPrototypeId = (Long)attributes.get("layoutPrototypeId");
221    
222                    if (layoutPrototypeId != null) {
223                            setLayoutPrototypeId(layoutPrototypeId);
224                    }
225    
226                    Long companyId = (Long)attributes.get("companyId");
227    
228                    if (companyId != null) {
229                            setCompanyId(companyId);
230                    }
231    
232                    Long userId = (Long)attributes.get("userId");
233    
234                    if (userId != null) {
235                            setUserId(userId);
236                    }
237    
238                    String userName = (String)attributes.get("userName");
239    
240                    if (userName != null) {
241                            setUserName(userName);
242                    }
243    
244                    Date createDate = (Date)attributes.get("createDate");
245    
246                    if (createDate != null) {
247                            setCreateDate(createDate);
248                    }
249    
250                    Date modifiedDate = (Date)attributes.get("modifiedDate");
251    
252                    if (modifiedDate != null) {
253                            setModifiedDate(modifiedDate);
254                    }
255    
256                    String name = (String)attributes.get("name");
257    
258                    if (name != null) {
259                            setName(name);
260                    }
261    
262                    String description = (String)attributes.get("description");
263    
264                    if (description != null) {
265                            setDescription(description);
266                    }
267    
268                    String settings = (String)attributes.get("settings");
269    
270                    if (settings != null) {
271                            setSettings(settings);
272                    }
273    
274                    Boolean active = (Boolean)attributes.get("active");
275    
276                    if (active != null) {
277                            setActive(active);
278                    }
279            }
280    
281            @JSON
282            @Override
283            public String getUuid() {
284                    if (_uuid == null) {
285                            return StringPool.BLANK;
286                    }
287                    else {
288                            return _uuid;
289                    }
290            }
291    
292            @Override
293            public void setUuid(String uuid) {
294                    if (_originalUuid == null) {
295                            _originalUuid = _uuid;
296                    }
297    
298                    _uuid = uuid;
299            }
300    
301            public String getOriginalUuid() {
302                    return GetterUtil.getString(_originalUuid);
303            }
304    
305            @JSON
306            @Override
307            public long getLayoutPrototypeId() {
308                    return _layoutPrototypeId;
309            }
310    
311            @Override
312            public void setLayoutPrototypeId(long layoutPrototypeId) {
313                    _layoutPrototypeId = layoutPrototypeId;
314            }
315    
316            @JSON
317            @Override
318            public long getCompanyId() {
319                    return _companyId;
320            }
321    
322            @Override
323            public void setCompanyId(long companyId) {
324                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
325    
326                    if (!_setOriginalCompanyId) {
327                            _setOriginalCompanyId = true;
328    
329                            _originalCompanyId = _companyId;
330                    }
331    
332                    _companyId = companyId;
333            }
334    
335            public long getOriginalCompanyId() {
336                    return _originalCompanyId;
337            }
338    
339            @JSON
340            @Override
341            public long getUserId() {
342                    return _userId;
343            }
344    
345            @Override
346            public void setUserId(long userId) {
347                    _userId = userId;
348            }
349    
350            @Override
351            public String getUserUuid() throws SystemException {
352                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
353            }
354    
355            @Override
356            public void setUserUuid(String userUuid) {
357                    _userUuid = userUuid;
358            }
359    
360            @JSON
361            @Override
362            public String getUserName() {
363                    if (_userName == null) {
364                            return StringPool.BLANK;
365                    }
366                    else {
367                            return _userName;
368                    }
369            }
370    
371            @Override
372            public void setUserName(String userName) {
373                    _userName = userName;
374            }
375    
376            @JSON
377            @Override
378            public Date getCreateDate() {
379                    return _createDate;
380            }
381    
382            @Override
383            public void setCreateDate(Date createDate) {
384                    _createDate = createDate;
385            }
386    
387            @JSON
388            @Override
389            public Date getModifiedDate() {
390                    return _modifiedDate;
391            }
392    
393            @Override
394            public void setModifiedDate(Date modifiedDate) {
395                    _modifiedDate = modifiedDate;
396            }
397    
398            @JSON
399            @Override
400            public String getName() {
401                    if (_name == null) {
402                            return StringPool.BLANK;
403                    }
404                    else {
405                            return _name;
406                    }
407            }
408    
409            @Override
410            public String getName(Locale locale) {
411                    String languageId = LocaleUtil.toLanguageId(locale);
412    
413                    return getName(languageId);
414            }
415    
416            @Override
417            public String getName(Locale locale, boolean useDefault) {
418                    String languageId = LocaleUtil.toLanguageId(locale);
419    
420                    return getName(languageId, useDefault);
421            }
422    
423            @Override
424            public String getName(String languageId) {
425                    return LocalizationUtil.getLocalization(getName(), languageId);
426            }
427    
428            @Override
429            public String getName(String languageId, boolean useDefault) {
430                    return LocalizationUtil.getLocalization(getName(), languageId,
431                            useDefault);
432            }
433    
434            @Override
435            public String getNameCurrentLanguageId() {
436                    return _nameCurrentLanguageId;
437            }
438    
439            @JSON
440            @Override
441            public String getNameCurrentValue() {
442                    Locale locale = getLocale(_nameCurrentLanguageId);
443    
444                    return getName(locale);
445            }
446    
447            @Override
448            public Map<Locale, String> getNameMap() {
449                    return LocalizationUtil.getLocalizationMap(getName());
450            }
451    
452            @Override
453            public void setName(String name) {
454                    _name = name;
455            }
456    
457            @Override
458            public void setName(String name, Locale locale) {
459                    setName(name, locale, LocaleUtil.getDefault());
460            }
461    
462            @Override
463            public void setName(String name, Locale locale, Locale defaultLocale) {
464                    String languageId = LocaleUtil.toLanguageId(locale);
465                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
466    
467                    if (Validator.isNotNull(name)) {
468                            setName(LocalizationUtil.updateLocalization(getName(), "Name",
469                                            name, languageId, defaultLanguageId));
470                    }
471                    else {
472                            setName(LocalizationUtil.removeLocalization(getName(), "Name",
473                                            languageId));
474                    }
475            }
476    
477            @Override
478            public void setNameCurrentLanguageId(String languageId) {
479                    _nameCurrentLanguageId = languageId;
480            }
481    
482            @Override
483            public void setNameMap(Map<Locale, String> nameMap) {
484                    setNameMap(nameMap, LocaleUtil.getDefault());
485            }
486    
487            @Override
488            public void setNameMap(Map<Locale, String> nameMap, Locale defaultLocale) {
489                    if (nameMap == null) {
490                            return;
491                    }
492    
493                    setName(LocalizationUtil.updateLocalization(nameMap, getName(), "Name",
494                                    LocaleUtil.toLanguageId(defaultLocale)));
495            }
496    
497            @JSON
498            @Override
499            public String getDescription() {
500                    if (_description == null) {
501                            return StringPool.BLANK;
502                    }
503                    else {
504                            return _description;
505                    }
506            }
507    
508            @Override
509            public void setDescription(String description) {
510                    _description = description;
511            }
512    
513            @JSON
514            @Override
515            public String getSettings() {
516                    if (_settings == null) {
517                            return StringPool.BLANK;
518                    }
519                    else {
520                            return _settings;
521                    }
522            }
523    
524            @Override
525            public void setSettings(String settings) {
526                    _settings = settings;
527            }
528    
529            @JSON
530            @Override
531            public boolean getActive() {
532                    return _active;
533            }
534    
535            @Override
536            public boolean isActive() {
537                    return _active;
538            }
539    
540            @Override
541            public void setActive(boolean active) {
542                    _columnBitmask |= ACTIVE_COLUMN_BITMASK;
543    
544                    if (!_setOriginalActive) {
545                            _setOriginalActive = true;
546    
547                            _originalActive = _active;
548                    }
549    
550                    _active = active;
551            }
552    
553            public boolean getOriginalActive() {
554                    return _originalActive;
555            }
556    
557            @Override
558            public StagedModelType getStagedModelType() {
559                    return new StagedModelType(PortalUtil.getClassNameId(
560                                    LayoutPrototype.class.getName()));
561            }
562    
563            public long getColumnBitmask() {
564                    return _columnBitmask;
565            }
566    
567            @Override
568            public ExpandoBridge getExpandoBridge() {
569                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
570                            LayoutPrototype.class.getName(), getPrimaryKey());
571            }
572    
573            @Override
574            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
575                    ExpandoBridge expandoBridge = getExpandoBridge();
576    
577                    expandoBridge.setAttributes(serviceContext);
578            }
579    
580            @Override
581            public String[] getAvailableLanguageIds() {
582                    Set<String> availableLanguageIds = new TreeSet<String>();
583    
584                    Map<Locale, String> nameMap = getNameMap();
585    
586                    for (Map.Entry<Locale, String> entry : nameMap.entrySet()) {
587                            Locale locale = entry.getKey();
588                            String value = entry.getValue();
589    
590                            if (Validator.isNotNull(value)) {
591                                    availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
592                            }
593                    }
594    
595                    return availableLanguageIds.toArray(new String[availableLanguageIds.size()]);
596            }
597    
598            @Override
599            public String getDefaultLanguageId() {
600                    String xml = getName();
601    
602                    if (xml == null) {
603                            return StringPool.BLANK;
604                    }
605    
606                    return LocalizationUtil.getDefaultLanguageId(xml);
607            }
608    
609            @Override
610            public void prepareLocalizedFieldsForImport() throws LocaleException {
611                    prepareLocalizedFieldsForImport(null);
612            }
613    
614            @Override
615            @SuppressWarnings("unused")
616            public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
617                    throws LocaleException {
618                    Locale defaultLocale = LocaleUtil.getDefault();
619    
620                    String modelDefaultLanguageId = getDefaultLanguageId();
621    
622                    String name = getName(defaultLocale);
623    
624                    if (Validator.isNull(name)) {
625                            setName(getName(modelDefaultLanguageId), defaultLocale);
626                    }
627                    else {
628                            setName(getName(defaultLocale), defaultLocale, defaultLocale);
629                    }
630            }
631    
632            @Override
633            public LayoutPrototype toEscapedModel() {
634                    if (_escapedModel == null) {
635                            _escapedModel = (LayoutPrototype)ProxyUtil.newProxyInstance(_classLoader,
636                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
637                    }
638    
639                    return _escapedModel;
640            }
641    
642            @Override
643            public Object clone() {
644                    LayoutPrototypeImpl layoutPrototypeImpl = new LayoutPrototypeImpl();
645    
646                    layoutPrototypeImpl.setUuid(getUuid());
647                    layoutPrototypeImpl.setLayoutPrototypeId(getLayoutPrototypeId());
648                    layoutPrototypeImpl.setCompanyId(getCompanyId());
649                    layoutPrototypeImpl.setUserId(getUserId());
650                    layoutPrototypeImpl.setUserName(getUserName());
651                    layoutPrototypeImpl.setCreateDate(getCreateDate());
652                    layoutPrototypeImpl.setModifiedDate(getModifiedDate());
653                    layoutPrototypeImpl.setName(getName());
654                    layoutPrototypeImpl.setDescription(getDescription());
655                    layoutPrototypeImpl.setSettings(getSettings());
656                    layoutPrototypeImpl.setActive(getActive());
657    
658                    layoutPrototypeImpl.resetOriginalValues();
659    
660                    return layoutPrototypeImpl;
661            }
662    
663            @Override
664            public int compareTo(LayoutPrototype layoutPrototype) {
665                    long primaryKey = layoutPrototype.getPrimaryKey();
666    
667                    if (getPrimaryKey() < primaryKey) {
668                            return -1;
669                    }
670                    else if (getPrimaryKey() > primaryKey) {
671                            return 1;
672                    }
673                    else {
674                            return 0;
675                    }
676            }
677    
678            @Override
679            public boolean equals(Object obj) {
680                    if (this == obj) {
681                            return true;
682                    }
683    
684                    if (!(obj instanceof LayoutPrototype)) {
685                            return false;
686                    }
687    
688                    LayoutPrototype layoutPrototype = (LayoutPrototype)obj;
689    
690                    long primaryKey = layoutPrototype.getPrimaryKey();
691    
692                    if (getPrimaryKey() == primaryKey) {
693                            return true;
694                    }
695                    else {
696                            return false;
697                    }
698            }
699    
700            @Override
701            public int hashCode() {
702                    return (int)getPrimaryKey();
703            }
704    
705            @Override
706            public void resetOriginalValues() {
707                    LayoutPrototypeModelImpl layoutPrototypeModelImpl = this;
708    
709                    layoutPrototypeModelImpl._originalUuid = layoutPrototypeModelImpl._uuid;
710    
711                    layoutPrototypeModelImpl._originalCompanyId = layoutPrototypeModelImpl._companyId;
712    
713                    layoutPrototypeModelImpl._setOriginalCompanyId = false;
714    
715                    layoutPrototypeModelImpl._originalActive = layoutPrototypeModelImpl._active;
716    
717                    layoutPrototypeModelImpl._setOriginalActive = false;
718    
719                    layoutPrototypeModelImpl._columnBitmask = 0;
720            }
721    
722            @Override
723            public CacheModel<LayoutPrototype> toCacheModel() {
724                    LayoutPrototypeCacheModel layoutPrototypeCacheModel = new LayoutPrototypeCacheModel();
725    
726                    layoutPrototypeCacheModel.uuid = getUuid();
727    
728                    String uuid = layoutPrototypeCacheModel.uuid;
729    
730                    if ((uuid != null) && (uuid.length() == 0)) {
731                            layoutPrototypeCacheModel.uuid = null;
732                    }
733    
734                    layoutPrototypeCacheModel.layoutPrototypeId = getLayoutPrototypeId();
735    
736                    layoutPrototypeCacheModel.companyId = getCompanyId();
737    
738                    layoutPrototypeCacheModel.userId = getUserId();
739    
740                    layoutPrototypeCacheModel.userName = getUserName();
741    
742                    String userName = layoutPrototypeCacheModel.userName;
743    
744                    if ((userName != null) && (userName.length() == 0)) {
745                            layoutPrototypeCacheModel.userName = null;
746                    }
747    
748                    Date createDate = getCreateDate();
749    
750                    if (createDate != null) {
751                            layoutPrototypeCacheModel.createDate = createDate.getTime();
752                    }
753                    else {
754                            layoutPrototypeCacheModel.createDate = Long.MIN_VALUE;
755                    }
756    
757                    Date modifiedDate = getModifiedDate();
758    
759                    if (modifiedDate != null) {
760                            layoutPrototypeCacheModel.modifiedDate = modifiedDate.getTime();
761                    }
762                    else {
763                            layoutPrototypeCacheModel.modifiedDate = Long.MIN_VALUE;
764                    }
765    
766                    layoutPrototypeCacheModel.name = getName();
767    
768                    String name = layoutPrototypeCacheModel.name;
769    
770                    if ((name != null) && (name.length() == 0)) {
771                            layoutPrototypeCacheModel.name = null;
772                    }
773    
774                    layoutPrototypeCacheModel.description = getDescription();
775    
776                    String description = layoutPrototypeCacheModel.description;
777    
778                    if ((description != null) && (description.length() == 0)) {
779                            layoutPrototypeCacheModel.description = null;
780                    }
781    
782                    layoutPrototypeCacheModel.settings = getSettings();
783    
784                    String settings = layoutPrototypeCacheModel.settings;
785    
786                    if ((settings != null) && (settings.length() == 0)) {
787                            layoutPrototypeCacheModel.settings = null;
788                    }
789    
790                    layoutPrototypeCacheModel.active = getActive();
791    
792                    return layoutPrototypeCacheModel;
793            }
794    
795            @Override
796            public String toString() {
797                    StringBundler sb = new StringBundler(23);
798    
799                    sb.append("{uuid=");
800                    sb.append(getUuid());
801                    sb.append(", layoutPrototypeId=");
802                    sb.append(getLayoutPrototypeId());
803                    sb.append(", companyId=");
804                    sb.append(getCompanyId());
805                    sb.append(", userId=");
806                    sb.append(getUserId());
807                    sb.append(", userName=");
808                    sb.append(getUserName());
809                    sb.append(", createDate=");
810                    sb.append(getCreateDate());
811                    sb.append(", modifiedDate=");
812                    sb.append(getModifiedDate());
813                    sb.append(", name=");
814                    sb.append(getName());
815                    sb.append(", description=");
816                    sb.append(getDescription());
817                    sb.append(", settings=");
818                    sb.append(getSettings());
819                    sb.append(", active=");
820                    sb.append(getActive());
821                    sb.append("}");
822    
823                    return sb.toString();
824            }
825    
826            @Override
827            public String toXmlString() {
828                    StringBundler sb = new StringBundler(37);
829    
830                    sb.append("<model><model-name>");
831                    sb.append("com.liferay.portal.model.LayoutPrototype");
832                    sb.append("</model-name>");
833    
834                    sb.append(
835                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
836                    sb.append(getUuid());
837                    sb.append("]]></column-value></column>");
838                    sb.append(
839                            "<column><column-name>layoutPrototypeId</column-name><column-value><![CDATA[");
840                    sb.append(getLayoutPrototypeId());
841                    sb.append("]]></column-value></column>");
842                    sb.append(
843                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
844                    sb.append(getCompanyId());
845                    sb.append("]]></column-value></column>");
846                    sb.append(
847                            "<column><column-name>userId</column-name><column-value><![CDATA[");
848                    sb.append(getUserId());
849                    sb.append("]]></column-value></column>");
850                    sb.append(
851                            "<column><column-name>userName</column-name><column-value><![CDATA[");
852                    sb.append(getUserName());
853                    sb.append("]]></column-value></column>");
854                    sb.append(
855                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
856                    sb.append(getCreateDate());
857                    sb.append("]]></column-value></column>");
858                    sb.append(
859                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
860                    sb.append(getModifiedDate());
861                    sb.append("]]></column-value></column>");
862                    sb.append(
863                            "<column><column-name>name</column-name><column-value><![CDATA[");
864                    sb.append(getName());
865                    sb.append("]]></column-value></column>");
866                    sb.append(
867                            "<column><column-name>description</column-name><column-value><![CDATA[");
868                    sb.append(getDescription());
869                    sb.append("]]></column-value></column>");
870                    sb.append(
871                            "<column><column-name>settings</column-name><column-value><![CDATA[");
872                    sb.append(getSettings());
873                    sb.append("]]></column-value></column>");
874                    sb.append(
875                            "<column><column-name>active</column-name><column-value><![CDATA[");
876                    sb.append(getActive());
877                    sb.append("]]></column-value></column>");
878    
879                    sb.append("</model>");
880    
881                    return sb.toString();
882            }
883    
884            private static ClassLoader _classLoader = LayoutPrototype.class.getClassLoader();
885            private static Class<?>[] _escapedModelInterfaces = new Class[] {
886                            LayoutPrototype.class
887                    };
888            private String _uuid;
889            private String _originalUuid;
890            private long _layoutPrototypeId;
891            private long _companyId;
892            private long _originalCompanyId;
893            private boolean _setOriginalCompanyId;
894            private long _userId;
895            private String _userUuid;
896            private String _userName;
897            private Date _createDate;
898            private Date _modifiedDate;
899            private String _name;
900            private String _nameCurrentLanguageId;
901            private String _description;
902            private String _settings;
903            private boolean _active;
904            private boolean _originalActive;
905            private boolean _setOriginalActive;
906            private long _columnBitmask;
907            private LayoutPrototype _escapedModel;
908    }