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