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.portal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.kernel.util.Validator;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.Group;
027    import com.liferay.portal.model.GroupModel;
028    import com.liferay.portal.model.GroupSoap;
029    import com.liferay.portal.service.ServiceContext;
030    import com.liferay.portal.util.PortalUtil;
031    
032    import com.liferay.portlet.expando.model.ExpandoBridge;
033    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
034    
035    import java.io.Serializable;
036    
037    import java.sql.Types;
038    
039    import java.util.ArrayList;
040    import java.util.HashMap;
041    import java.util.List;
042    import java.util.Map;
043    
044    /**
045     * The base model implementation for the Group service. Represents a row in the "Group_" database table, with each column mapped to a property of this class.
046     *
047     * <p>
048     * This implementation and its corresponding interface {@link com.liferay.portal.model.GroupModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link GroupImpl}.
049     * </p>
050     *
051     * @author Brian Wing Shun Chan
052     * @see GroupImpl
053     * @see com.liferay.portal.model.Group
054     * @see com.liferay.portal.model.GroupModel
055     * @generated
056     */
057    @JSON(strict = true)
058    public class GroupModelImpl extends BaseModelImpl<Group> implements GroupModel {
059            /*
060             * NOTE FOR DEVELOPERS:
061             *
062             * Never modify or reference this class directly. All methods that expect a group model instance should use the {@link com.liferay.portal.model.Group} interface instead.
063             */
064            public static final String TABLE_NAME = "Group_";
065            public static final Object[][] TABLE_COLUMNS = {
066                            { "groupId", Types.BIGINT },
067                            { "companyId", Types.BIGINT },
068                            { "creatorUserId", Types.BIGINT },
069                            { "classNameId", Types.BIGINT },
070                            { "classPK", Types.BIGINT },
071                            { "parentGroupId", Types.BIGINT },
072                            { "liveGroupId", Types.BIGINT },
073                            { "name", Types.VARCHAR },
074                            { "description", Types.VARCHAR },
075                            { "type_", Types.INTEGER },
076                            { "typeSettings", Types.VARCHAR },
077                            { "friendlyURL", Types.VARCHAR },
078                            { "site", Types.BOOLEAN },
079                            { "active_", Types.BOOLEAN }
080                    };
081            public static final String TABLE_SQL_CREATE = "create table Group_ (groupId LONG not null primary key,companyId LONG,creatorUserId LONG,classNameId LONG,classPK LONG,parentGroupId LONG,liveGroupId LONG,name VARCHAR(150) null,description STRING null,type_ INTEGER,typeSettings STRING null,friendlyURL VARCHAR(100) null,site BOOLEAN,active_ BOOLEAN)";
082            public static final String TABLE_SQL_DROP = "drop table Group_";
083            public static final String ORDER_BY_JPQL = " ORDER BY group_.name ASC";
084            public static final String ORDER_BY_SQL = " ORDER BY Group_.name ASC";
085            public static final String DATA_SOURCE = "liferayDataSource";
086            public static final String SESSION_FACTORY = "liferaySessionFactory";
087            public static final String TX_MANAGER = "liferayTransactionManager";
088            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
089                                    "value.object.entity.cache.enabled.com.liferay.portal.model.Group"),
090                            true);
091            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
092                                    "value.object.finder.cache.enabled.com.liferay.portal.model.Group"),
093                            true);
094            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
095                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.Group"),
096                            true);
097            public static long ACTIVE_COLUMN_BITMASK = 1L;
098            public static long CLASSNAMEID_COLUMN_BITMASK = 2L;
099            public static long CLASSPK_COLUMN_BITMASK = 4L;
100            public static long COMPANYID_COLUMN_BITMASK = 8L;
101            public static long FRIENDLYURL_COLUMN_BITMASK = 16L;
102            public static long LIVEGROUPID_COLUMN_BITMASK = 32L;
103            public static long NAME_COLUMN_BITMASK = 64L;
104            public static long PARENTGROUPID_COLUMN_BITMASK = 128L;
105            public static long SITE_COLUMN_BITMASK = 256L;
106            public static long TYPE_COLUMN_BITMASK = 512L;
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 Group toModel(GroupSoap soapModel) {
115                    if (soapModel == null) {
116                            return null;
117                    }
118    
119                    Group model = new GroupImpl();
120    
121                    model.setGroupId(soapModel.getGroupId());
122                    model.setCompanyId(soapModel.getCompanyId());
123                    model.setCreatorUserId(soapModel.getCreatorUserId());
124                    model.setClassNameId(soapModel.getClassNameId());
125                    model.setClassPK(soapModel.getClassPK());
126                    model.setParentGroupId(soapModel.getParentGroupId());
127                    model.setLiveGroupId(soapModel.getLiveGroupId());
128                    model.setName(soapModel.getName());
129                    model.setDescription(soapModel.getDescription());
130                    model.setType(soapModel.getType());
131                    model.setTypeSettings(soapModel.getTypeSettings());
132                    model.setFriendlyURL(soapModel.getFriendlyURL());
133                    model.setSite(soapModel.getSite());
134                    model.setActive(soapModel.getActive());
135    
136                    return model;
137            }
138    
139            /**
140             * Converts the soap model instances into normal model instances.
141             *
142             * @param soapModels the soap model instances to convert
143             * @return the normal model instances
144             */
145            public static List<Group> toModels(GroupSoap[] soapModels) {
146                    if (soapModels == null) {
147                            return null;
148                    }
149    
150                    List<Group> models = new ArrayList<Group>(soapModels.length);
151    
152                    for (GroupSoap soapModel : soapModels) {
153                            models.add(toModel(soapModel));
154                    }
155    
156                    return models;
157            }
158    
159            public static final String MAPPING_TABLE_GROUPS_ORGS_NAME = "Groups_Orgs";
160            public static final Object[][] MAPPING_TABLE_GROUPS_ORGS_COLUMNS = {
161                            { "groupId", Types.BIGINT },
162                            { "organizationId", Types.BIGINT }
163                    };
164            public static final String MAPPING_TABLE_GROUPS_ORGS_SQL_CREATE = "create table Groups_Orgs (groupId LONG not null,organizationId LONG not null,primary key (groupId, organizationId))";
165            public static final boolean FINDER_CACHE_ENABLED_GROUPS_ORGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
166                                    "value.object.finder.cache.enabled.Groups_Orgs"), true);
167            public static final String MAPPING_TABLE_GROUPS_ROLES_NAME = "Groups_Roles";
168            public static final Object[][] MAPPING_TABLE_GROUPS_ROLES_COLUMNS = {
169                            { "groupId", Types.BIGINT },
170                            { "roleId", Types.BIGINT }
171                    };
172            public static final String MAPPING_TABLE_GROUPS_ROLES_SQL_CREATE = "create table Groups_Roles (groupId LONG not null,roleId LONG not null,primary key (groupId, roleId))";
173            public static final boolean FINDER_CACHE_ENABLED_GROUPS_ROLES = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
174                                    "value.object.finder.cache.enabled.Groups_Roles"), true);
175            public static final String MAPPING_TABLE_GROUPS_USERGROUPS_NAME = "Groups_UserGroups";
176            public static final Object[][] MAPPING_TABLE_GROUPS_USERGROUPS_COLUMNS = {
177                            { "groupId", Types.BIGINT },
178                            { "userGroupId", Types.BIGINT }
179                    };
180            public static final String MAPPING_TABLE_GROUPS_USERGROUPS_SQL_CREATE = "create table Groups_UserGroups (groupId LONG not null,userGroupId LONG not null,primary key (groupId, userGroupId))";
181            public static final boolean FINDER_CACHE_ENABLED_GROUPS_USERGROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
182                                    "value.object.finder.cache.enabled.Groups_UserGroups"), true);
183            public static final String MAPPING_TABLE_USERS_GROUPS_NAME = "Users_Groups";
184            public static final Object[][] MAPPING_TABLE_USERS_GROUPS_COLUMNS = {
185                            { "userId", Types.BIGINT },
186                            { "groupId", Types.BIGINT }
187                    };
188            public static final String MAPPING_TABLE_USERS_GROUPS_SQL_CREATE = "create table Users_Groups (userId LONG not null,groupId LONG not null,primary key (userId, groupId))";
189            public static final boolean FINDER_CACHE_ENABLED_USERS_GROUPS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
190                                    "value.object.finder.cache.enabled.Users_Groups"), true);
191            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
192                                    "lock.expiration.time.com.liferay.portal.model.Group"));
193    
194            public GroupModelImpl() {
195            }
196    
197            public long getPrimaryKey() {
198                    return _groupId;
199            }
200    
201            public void setPrimaryKey(long primaryKey) {
202                    setGroupId(primaryKey);
203            }
204    
205            public Serializable getPrimaryKeyObj() {
206                    return new Long(_groupId);
207            }
208    
209            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
210                    setPrimaryKey(((Long)primaryKeyObj).longValue());
211            }
212    
213            public Class<?> getModelClass() {
214                    return Group.class;
215            }
216    
217            public String getModelClassName() {
218                    return Group.class.getName();
219            }
220    
221            @Override
222            public Map<String, Object> getModelAttributes() {
223                    Map<String, Object> attributes = new HashMap<String, Object>();
224    
225                    attributes.put("groupId", getGroupId());
226                    attributes.put("companyId", getCompanyId());
227                    attributes.put("creatorUserId", getCreatorUserId());
228                    attributes.put("classNameId", getClassNameId());
229                    attributes.put("classPK", getClassPK());
230                    attributes.put("parentGroupId", getParentGroupId());
231                    attributes.put("liveGroupId", getLiveGroupId());
232                    attributes.put("name", getName());
233                    attributes.put("description", getDescription());
234                    attributes.put("type", getType());
235                    attributes.put("typeSettings", getTypeSettings());
236                    attributes.put("friendlyURL", getFriendlyURL());
237                    attributes.put("site", getSite());
238                    attributes.put("active", getActive());
239    
240                    return attributes;
241            }
242    
243            @Override
244            public void setModelAttributes(Map<String, Object> attributes) {
245                    Long groupId = (Long)attributes.get("groupId");
246    
247                    if (groupId != null) {
248                            setGroupId(groupId);
249                    }
250    
251                    Long companyId = (Long)attributes.get("companyId");
252    
253                    if (companyId != null) {
254                            setCompanyId(companyId);
255                    }
256    
257                    Long creatorUserId = (Long)attributes.get("creatorUserId");
258    
259                    if (creatorUserId != null) {
260                            setCreatorUserId(creatorUserId);
261                    }
262    
263                    Long classNameId = (Long)attributes.get("classNameId");
264    
265                    if (classNameId != null) {
266                            setClassNameId(classNameId);
267                    }
268    
269                    Long classPK = (Long)attributes.get("classPK");
270    
271                    if (classPK != null) {
272                            setClassPK(classPK);
273                    }
274    
275                    Long parentGroupId = (Long)attributes.get("parentGroupId");
276    
277                    if (parentGroupId != null) {
278                            setParentGroupId(parentGroupId);
279                    }
280    
281                    Long liveGroupId = (Long)attributes.get("liveGroupId");
282    
283                    if (liveGroupId != null) {
284                            setLiveGroupId(liveGroupId);
285                    }
286    
287                    String name = (String)attributes.get("name");
288    
289                    if (name != null) {
290                            setName(name);
291                    }
292    
293                    String description = (String)attributes.get("description");
294    
295                    if (description != null) {
296                            setDescription(description);
297                    }
298    
299                    Integer type = (Integer)attributes.get("type");
300    
301                    if (type != null) {
302                            setType(type);
303                    }
304    
305                    String typeSettings = (String)attributes.get("typeSettings");
306    
307                    if (typeSettings != null) {
308                            setTypeSettings(typeSettings);
309                    }
310    
311                    String friendlyURL = (String)attributes.get("friendlyURL");
312    
313                    if (friendlyURL != null) {
314                            setFriendlyURL(friendlyURL);
315                    }
316    
317                    Boolean site = (Boolean)attributes.get("site");
318    
319                    if (site != null) {
320                            setSite(site);
321                    }
322    
323                    Boolean active = (Boolean)attributes.get("active");
324    
325                    if (active != null) {
326                            setActive(active);
327                    }
328            }
329    
330            @JSON
331            public long getGroupId() {
332                    return _groupId;
333            }
334    
335            public void setGroupId(long groupId) {
336                    _groupId = groupId;
337            }
338    
339            @JSON
340            public long getCompanyId() {
341                    return _companyId;
342            }
343    
344            public void setCompanyId(long companyId) {
345                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
346    
347                    if (!_setOriginalCompanyId) {
348                            _setOriginalCompanyId = true;
349    
350                            _originalCompanyId = _companyId;
351                    }
352    
353                    _companyId = companyId;
354            }
355    
356            public long getOriginalCompanyId() {
357                    return _originalCompanyId;
358            }
359    
360            @JSON
361            public long getCreatorUserId() {
362                    return _creatorUserId;
363            }
364    
365            public void setCreatorUserId(long creatorUserId) {
366                    _creatorUserId = creatorUserId;
367            }
368    
369            public String getCreatorUserUuid() throws SystemException {
370                    return PortalUtil.getUserValue(getCreatorUserId(), "uuid",
371                            _creatorUserUuid);
372            }
373    
374            public void setCreatorUserUuid(String creatorUserUuid) {
375                    _creatorUserUuid = creatorUserUuid;
376            }
377    
378            public String getClassName() {
379                    if (getClassNameId() <= 0) {
380                            return StringPool.BLANK;
381                    }
382    
383                    return PortalUtil.getClassName(getClassNameId());
384            }
385    
386            public void setClassName(String className) {
387                    long classNameId = 0;
388    
389                    if (Validator.isNotNull(className)) {
390                            classNameId = PortalUtil.getClassNameId(className);
391                    }
392    
393                    setClassNameId(classNameId);
394            }
395    
396            @JSON
397            public long getClassNameId() {
398                    return _classNameId;
399            }
400    
401            public void setClassNameId(long classNameId) {
402                    _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
403    
404                    if (!_setOriginalClassNameId) {
405                            _setOriginalClassNameId = true;
406    
407                            _originalClassNameId = _classNameId;
408                    }
409    
410                    _classNameId = classNameId;
411            }
412    
413            public long getOriginalClassNameId() {
414                    return _originalClassNameId;
415            }
416    
417            @JSON
418            public long getClassPK() {
419                    return _classPK;
420            }
421    
422            public void setClassPK(long classPK) {
423                    _columnBitmask |= CLASSPK_COLUMN_BITMASK;
424    
425                    if (!_setOriginalClassPK) {
426                            _setOriginalClassPK = true;
427    
428                            _originalClassPK = _classPK;
429                    }
430    
431                    _classPK = classPK;
432            }
433    
434            public long getOriginalClassPK() {
435                    return _originalClassPK;
436            }
437    
438            @JSON
439            public long getParentGroupId() {
440                    return _parentGroupId;
441            }
442    
443            public void setParentGroupId(long parentGroupId) {
444                    _columnBitmask |= PARENTGROUPID_COLUMN_BITMASK;
445    
446                    if (!_setOriginalParentGroupId) {
447                            _setOriginalParentGroupId = true;
448    
449                            _originalParentGroupId = _parentGroupId;
450                    }
451    
452                    _parentGroupId = parentGroupId;
453            }
454    
455            public long getOriginalParentGroupId() {
456                    return _originalParentGroupId;
457            }
458    
459            @JSON
460            public long getLiveGroupId() {
461                    return _liveGroupId;
462            }
463    
464            public void setLiveGroupId(long liveGroupId) {
465                    _columnBitmask |= LIVEGROUPID_COLUMN_BITMASK;
466    
467                    if (!_setOriginalLiveGroupId) {
468                            _setOriginalLiveGroupId = true;
469    
470                            _originalLiveGroupId = _liveGroupId;
471                    }
472    
473                    _liveGroupId = liveGroupId;
474            }
475    
476            public long getOriginalLiveGroupId() {
477                    return _originalLiveGroupId;
478            }
479    
480            @JSON
481            public String getName() {
482                    if (_name == null) {
483                            return StringPool.BLANK;
484                    }
485                    else {
486                            return _name;
487                    }
488            }
489    
490            public void setName(String name) {
491                    _columnBitmask = -1L;
492    
493                    if (_originalName == null) {
494                            _originalName = _name;
495                    }
496    
497                    _name = name;
498            }
499    
500            public String getOriginalName() {
501                    return GetterUtil.getString(_originalName);
502            }
503    
504            @JSON
505            public String getDescription() {
506                    if (_description == null) {
507                            return StringPool.BLANK;
508                    }
509                    else {
510                            return _description;
511                    }
512            }
513    
514            public void setDescription(String description) {
515                    _description = description;
516            }
517    
518            @JSON
519            public int getType() {
520                    return _type;
521            }
522    
523            public void setType(int type) {
524                    _columnBitmask |= TYPE_COLUMN_BITMASK;
525    
526                    if (!_setOriginalType) {
527                            _setOriginalType = true;
528    
529                            _originalType = _type;
530                    }
531    
532                    _type = type;
533            }
534    
535            public int getOriginalType() {
536                    return _originalType;
537            }
538    
539            @JSON
540            public String getTypeSettings() {
541                    if (_typeSettings == null) {
542                            return StringPool.BLANK;
543                    }
544                    else {
545                            return _typeSettings;
546                    }
547            }
548    
549            public void setTypeSettings(String typeSettings) {
550                    _typeSettings = typeSettings;
551            }
552    
553            @JSON
554            public String getFriendlyURL() {
555                    if (_friendlyURL == null) {
556                            return StringPool.BLANK;
557                    }
558                    else {
559                            return _friendlyURL;
560                    }
561            }
562    
563            public void setFriendlyURL(String friendlyURL) {
564                    _columnBitmask |= FRIENDLYURL_COLUMN_BITMASK;
565    
566                    if (_originalFriendlyURL == null) {
567                            _originalFriendlyURL = _friendlyURL;
568                    }
569    
570                    _friendlyURL = friendlyURL;
571            }
572    
573            public String getOriginalFriendlyURL() {
574                    return GetterUtil.getString(_originalFriendlyURL);
575            }
576    
577            @JSON
578            public boolean getSite() {
579                    return _site;
580            }
581    
582            public boolean isSite() {
583                    return _site;
584            }
585    
586            public void setSite(boolean site) {
587                    _columnBitmask |= SITE_COLUMN_BITMASK;
588    
589                    if (!_setOriginalSite) {
590                            _setOriginalSite = true;
591    
592                            _originalSite = _site;
593                    }
594    
595                    _site = site;
596            }
597    
598            public boolean getOriginalSite() {
599                    return _originalSite;
600            }
601    
602            @JSON
603            public boolean getActive() {
604                    return _active;
605            }
606    
607            public boolean isActive() {
608                    return _active;
609            }
610    
611            public void setActive(boolean active) {
612                    _columnBitmask |= ACTIVE_COLUMN_BITMASK;
613    
614                    if (!_setOriginalActive) {
615                            _setOriginalActive = true;
616    
617                            _originalActive = _active;
618                    }
619    
620                    _active = active;
621            }
622    
623            public boolean getOriginalActive() {
624                    return _originalActive;
625            }
626    
627            public long getColumnBitmask() {
628                    return _columnBitmask;
629            }
630    
631            @Override
632            public ExpandoBridge getExpandoBridge() {
633                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
634                            Group.class.getName(), getPrimaryKey());
635            }
636    
637            @Override
638            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
639                    ExpandoBridge expandoBridge = getExpandoBridge();
640    
641                    expandoBridge.setAttributes(serviceContext);
642            }
643    
644            @Override
645            public Group toEscapedModel() {
646                    if (_escapedModel == null) {
647                            _escapedModel = (Group)ProxyUtil.newProxyInstance(_classLoader,
648                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
649                    }
650    
651                    return _escapedModel;
652            }
653    
654            @Override
655            public Object clone() {
656                    GroupImpl groupImpl = new GroupImpl();
657    
658                    groupImpl.setGroupId(getGroupId());
659                    groupImpl.setCompanyId(getCompanyId());
660                    groupImpl.setCreatorUserId(getCreatorUserId());
661                    groupImpl.setClassNameId(getClassNameId());
662                    groupImpl.setClassPK(getClassPK());
663                    groupImpl.setParentGroupId(getParentGroupId());
664                    groupImpl.setLiveGroupId(getLiveGroupId());
665                    groupImpl.setName(getName());
666                    groupImpl.setDescription(getDescription());
667                    groupImpl.setType(getType());
668                    groupImpl.setTypeSettings(getTypeSettings());
669                    groupImpl.setFriendlyURL(getFriendlyURL());
670                    groupImpl.setSite(getSite());
671                    groupImpl.setActive(getActive());
672    
673                    groupImpl.resetOriginalValues();
674    
675                    return groupImpl;
676            }
677    
678            public int compareTo(Group group) {
679                    int value = 0;
680    
681                    value = getName().toLowerCase().compareTo(group.getName().toLowerCase());
682    
683                    if (value != 0) {
684                            return value;
685                    }
686    
687                    return 0;
688            }
689    
690            @Override
691            public boolean equals(Object obj) {
692                    if (obj == null) {
693                            return false;
694                    }
695    
696                    Group group = null;
697    
698                    try {
699                            group = (Group)obj;
700                    }
701                    catch (ClassCastException cce) {
702                            return false;
703                    }
704    
705                    long primaryKey = group.getPrimaryKey();
706    
707                    if (getPrimaryKey() == primaryKey) {
708                            return true;
709                    }
710                    else {
711                            return false;
712                    }
713            }
714    
715            @Override
716            public int hashCode() {
717                    return (int)getPrimaryKey();
718            }
719    
720            @Override
721            public void resetOriginalValues() {
722                    GroupModelImpl groupModelImpl = this;
723    
724                    groupModelImpl._originalCompanyId = groupModelImpl._companyId;
725    
726                    groupModelImpl._setOriginalCompanyId = false;
727    
728                    groupModelImpl._originalClassNameId = groupModelImpl._classNameId;
729    
730                    groupModelImpl._setOriginalClassNameId = false;
731    
732                    groupModelImpl._originalClassPK = groupModelImpl._classPK;
733    
734                    groupModelImpl._setOriginalClassPK = false;
735    
736                    groupModelImpl._originalParentGroupId = groupModelImpl._parentGroupId;
737    
738                    groupModelImpl._setOriginalParentGroupId = false;
739    
740                    groupModelImpl._originalLiveGroupId = groupModelImpl._liveGroupId;
741    
742                    groupModelImpl._setOriginalLiveGroupId = false;
743    
744                    groupModelImpl._originalName = groupModelImpl._name;
745    
746                    groupModelImpl._originalType = groupModelImpl._type;
747    
748                    groupModelImpl._setOriginalType = false;
749    
750                    groupModelImpl._originalFriendlyURL = groupModelImpl._friendlyURL;
751    
752                    groupModelImpl._originalSite = groupModelImpl._site;
753    
754                    groupModelImpl._setOriginalSite = false;
755    
756                    groupModelImpl._originalActive = groupModelImpl._active;
757    
758                    groupModelImpl._setOriginalActive = false;
759    
760                    groupModelImpl._columnBitmask = 0;
761            }
762    
763            @Override
764            public CacheModel<Group> toCacheModel() {
765                    GroupCacheModel groupCacheModel = new GroupCacheModel();
766    
767                    groupCacheModel.groupId = getGroupId();
768    
769                    groupCacheModel.companyId = getCompanyId();
770    
771                    groupCacheModel.creatorUserId = getCreatorUserId();
772    
773                    groupCacheModel.classNameId = getClassNameId();
774    
775                    groupCacheModel.classPK = getClassPK();
776    
777                    groupCacheModel.parentGroupId = getParentGroupId();
778    
779                    groupCacheModel.liveGroupId = getLiveGroupId();
780    
781                    groupCacheModel.name = getName();
782    
783                    String name = groupCacheModel.name;
784    
785                    if ((name != null) && (name.length() == 0)) {
786                            groupCacheModel.name = null;
787                    }
788    
789                    groupCacheModel.description = getDescription();
790    
791                    String description = groupCacheModel.description;
792    
793                    if ((description != null) && (description.length() == 0)) {
794                            groupCacheModel.description = null;
795                    }
796    
797                    groupCacheModel.type = getType();
798    
799                    groupCacheModel.typeSettings = getTypeSettings();
800    
801                    String typeSettings = groupCacheModel.typeSettings;
802    
803                    if ((typeSettings != null) && (typeSettings.length() == 0)) {
804                            groupCacheModel.typeSettings = null;
805                    }
806    
807                    groupCacheModel.friendlyURL = getFriendlyURL();
808    
809                    String friendlyURL = groupCacheModel.friendlyURL;
810    
811                    if ((friendlyURL != null) && (friendlyURL.length() == 0)) {
812                            groupCacheModel.friendlyURL = null;
813                    }
814    
815                    groupCacheModel.site = getSite();
816    
817                    groupCacheModel.active = getActive();
818    
819                    return groupCacheModel;
820            }
821    
822            @Override
823            public String toString() {
824                    StringBundler sb = new StringBundler(29);
825    
826                    sb.append("{groupId=");
827                    sb.append(getGroupId());
828                    sb.append(", companyId=");
829                    sb.append(getCompanyId());
830                    sb.append(", creatorUserId=");
831                    sb.append(getCreatorUserId());
832                    sb.append(", classNameId=");
833                    sb.append(getClassNameId());
834                    sb.append(", classPK=");
835                    sb.append(getClassPK());
836                    sb.append(", parentGroupId=");
837                    sb.append(getParentGroupId());
838                    sb.append(", liveGroupId=");
839                    sb.append(getLiveGroupId());
840                    sb.append(", name=");
841                    sb.append(getName());
842                    sb.append(", description=");
843                    sb.append(getDescription());
844                    sb.append(", type=");
845                    sb.append(getType());
846                    sb.append(", typeSettings=");
847                    sb.append(getTypeSettings());
848                    sb.append(", friendlyURL=");
849                    sb.append(getFriendlyURL());
850                    sb.append(", site=");
851                    sb.append(getSite());
852                    sb.append(", active=");
853                    sb.append(getActive());
854                    sb.append("}");
855    
856                    return sb.toString();
857            }
858    
859            public String toXmlString() {
860                    StringBundler sb = new StringBundler(46);
861    
862                    sb.append("<model><model-name>");
863                    sb.append("com.liferay.portal.model.Group");
864                    sb.append("</model-name>");
865    
866                    sb.append(
867                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
868                    sb.append(getGroupId());
869                    sb.append("]]></column-value></column>");
870                    sb.append(
871                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
872                    sb.append(getCompanyId());
873                    sb.append("]]></column-value></column>");
874                    sb.append(
875                            "<column><column-name>creatorUserId</column-name><column-value><![CDATA[");
876                    sb.append(getCreatorUserId());
877                    sb.append("]]></column-value></column>");
878                    sb.append(
879                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
880                    sb.append(getClassNameId());
881                    sb.append("]]></column-value></column>");
882                    sb.append(
883                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
884                    sb.append(getClassPK());
885                    sb.append("]]></column-value></column>");
886                    sb.append(
887                            "<column><column-name>parentGroupId</column-name><column-value><![CDATA[");
888                    sb.append(getParentGroupId());
889                    sb.append("]]></column-value></column>");
890                    sb.append(
891                            "<column><column-name>liveGroupId</column-name><column-value><![CDATA[");
892                    sb.append(getLiveGroupId());
893                    sb.append("]]></column-value></column>");
894                    sb.append(
895                            "<column><column-name>name</column-name><column-value><![CDATA[");
896                    sb.append(getName());
897                    sb.append("]]></column-value></column>");
898                    sb.append(
899                            "<column><column-name>description</column-name><column-value><![CDATA[");
900                    sb.append(getDescription());
901                    sb.append("]]></column-value></column>");
902                    sb.append(
903                            "<column><column-name>type</column-name><column-value><![CDATA[");
904                    sb.append(getType());
905                    sb.append("]]></column-value></column>");
906                    sb.append(
907                            "<column><column-name>typeSettings</column-name><column-value><![CDATA[");
908                    sb.append(getTypeSettings());
909                    sb.append("]]></column-value></column>");
910                    sb.append(
911                            "<column><column-name>friendlyURL</column-name><column-value><![CDATA[");
912                    sb.append(getFriendlyURL());
913                    sb.append("]]></column-value></column>");
914                    sb.append(
915                            "<column><column-name>site</column-name><column-value><![CDATA[");
916                    sb.append(getSite());
917                    sb.append("]]></column-value></column>");
918                    sb.append(
919                            "<column><column-name>active</column-name><column-value><![CDATA[");
920                    sb.append(getActive());
921                    sb.append("]]></column-value></column>");
922    
923                    sb.append("</model>");
924    
925                    return sb.toString();
926            }
927    
928            private static ClassLoader _classLoader = Group.class.getClassLoader();
929            private static Class<?>[] _escapedModelInterfaces = new Class[] { Group.class };
930            private long _groupId;
931            private long _companyId;
932            private long _originalCompanyId;
933            private boolean _setOriginalCompanyId;
934            private long _creatorUserId;
935            private String _creatorUserUuid;
936            private long _classNameId;
937            private long _originalClassNameId;
938            private boolean _setOriginalClassNameId;
939            private long _classPK;
940            private long _originalClassPK;
941            private boolean _setOriginalClassPK;
942            private long _parentGroupId;
943            private long _originalParentGroupId;
944            private boolean _setOriginalParentGroupId;
945            private long _liveGroupId;
946            private long _originalLiveGroupId;
947            private boolean _setOriginalLiveGroupId;
948            private String _name;
949            private String _originalName;
950            private String _description;
951            private int _type;
952            private int _originalType;
953            private boolean _setOriginalType;
954            private String _typeSettings;
955            private String _friendlyURL;
956            private String _originalFriendlyURL;
957            private boolean _site;
958            private boolean _originalSite;
959            private boolean _setOriginalSite;
960            private boolean _active;
961            private boolean _originalActive;
962            private boolean _setOriginalActive;
963            private long _columnBitmask;
964            private Group _escapedModel;
965    }