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 (_escapedModelProxy == null) {
647                            _escapedModelProxy = (Group)ProxyUtil.newProxyInstance(_classLoader,
648                                            _escapedModelProxyInterfaces,
649                                            new AutoEscapeBeanHandler(this));
650                    }
651    
652                    return _escapedModelProxy;
653            }
654    
655            @Override
656            public Object clone() {
657                    GroupImpl groupImpl = new GroupImpl();
658    
659                    groupImpl.setGroupId(getGroupId());
660                    groupImpl.setCompanyId(getCompanyId());
661                    groupImpl.setCreatorUserId(getCreatorUserId());
662                    groupImpl.setClassNameId(getClassNameId());
663                    groupImpl.setClassPK(getClassPK());
664                    groupImpl.setParentGroupId(getParentGroupId());
665                    groupImpl.setLiveGroupId(getLiveGroupId());
666                    groupImpl.setName(getName());
667                    groupImpl.setDescription(getDescription());
668                    groupImpl.setType(getType());
669                    groupImpl.setTypeSettings(getTypeSettings());
670                    groupImpl.setFriendlyURL(getFriendlyURL());
671                    groupImpl.setSite(getSite());
672                    groupImpl.setActive(getActive());
673    
674                    groupImpl.resetOriginalValues();
675    
676                    return groupImpl;
677            }
678    
679            public int compareTo(Group group) {
680                    int value = 0;
681    
682                    value = getName().toLowerCase().compareTo(group.getName().toLowerCase());
683    
684                    if (value != 0) {
685                            return value;
686                    }
687    
688                    return 0;
689            }
690    
691            @Override
692            public boolean equals(Object obj) {
693                    if (obj == null) {
694                            return false;
695                    }
696    
697                    Group group = null;
698    
699                    try {
700                            group = (Group)obj;
701                    }
702                    catch (ClassCastException cce) {
703                            return false;
704                    }
705    
706                    long primaryKey = group.getPrimaryKey();
707    
708                    if (getPrimaryKey() == primaryKey) {
709                            return true;
710                    }
711                    else {
712                            return false;
713                    }
714            }
715    
716            @Override
717            public int hashCode() {
718                    return (int)getPrimaryKey();
719            }
720    
721            @Override
722            public void resetOriginalValues() {
723                    GroupModelImpl groupModelImpl = this;
724    
725                    groupModelImpl._originalCompanyId = groupModelImpl._companyId;
726    
727                    groupModelImpl._setOriginalCompanyId = false;
728    
729                    groupModelImpl._originalClassNameId = groupModelImpl._classNameId;
730    
731                    groupModelImpl._setOriginalClassNameId = false;
732    
733                    groupModelImpl._originalClassPK = groupModelImpl._classPK;
734    
735                    groupModelImpl._setOriginalClassPK = false;
736    
737                    groupModelImpl._originalParentGroupId = groupModelImpl._parentGroupId;
738    
739                    groupModelImpl._setOriginalParentGroupId = false;
740    
741                    groupModelImpl._originalLiveGroupId = groupModelImpl._liveGroupId;
742    
743                    groupModelImpl._setOriginalLiveGroupId = false;
744    
745                    groupModelImpl._originalName = groupModelImpl._name;
746    
747                    groupModelImpl._originalType = groupModelImpl._type;
748    
749                    groupModelImpl._setOriginalType = false;
750    
751                    groupModelImpl._originalFriendlyURL = groupModelImpl._friendlyURL;
752    
753                    groupModelImpl._originalSite = groupModelImpl._site;
754    
755                    groupModelImpl._setOriginalSite = false;
756    
757                    groupModelImpl._originalActive = groupModelImpl._active;
758    
759                    groupModelImpl._setOriginalActive = false;
760    
761                    groupModelImpl._columnBitmask = 0;
762            }
763    
764            @Override
765            public CacheModel<Group> toCacheModel() {
766                    GroupCacheModel groupCacheModel = new GroupCacheModel();
767    
768                    groupCacheModel.groupId = getGroupId();
769    
770                    groupCacheModel.companyId = getCompanyId();
771    
772                    groupCacheModel.creatorUserId = getCreatorUserId();
773    
774                    groupCacheModel.classNameId = getClassNameId();
775    
776                    groupCacheModel.classPK = getClassPK();
777    
778                    groupCacheModel.parentGroupId = getParentGroupId();
779    
780                    groupCacheModel.liveGroupId = getLiveGroupId();
781    
782                    groupCacheModel.name = getName();
783    
784                    String name = groupCacheModel.name;
785    
786                    if ((name != null) && (name.length() == 0)) {
787                            groupCacheModel.name = null;
788                    }
789    
790                    groupCacheModel.description = getDescription();
791    
792                    String description = groupCacheModel.description;
793    
794                    if ((description != null) && (description.length() == 0)) {
795                            groupCacheModel.description = null;
796                    }
797    
798                    groupCacheModel.type = getType();
799    
800                    groupCacheModel.typeSettings = getTypeSettings();
801    
802                    String typeSettings = groupCacheModel.typeSettings;
803    
804                    if ((typeSettings != null) && (typeSettings.length() == 0)) {
805                            groupCacheModel.typeSettings = null;
806                    }
807    
808                    groupCacheModel.friendlyURL = getFriendlyURL();
809    
810                    String friendlyURL = groupCacheModel.friendlyURL;
811    
812                    if ((friendlyURL != null) && (friendlyURL.length() == 0)) {
813                            groupCacheModel.friendlyURL = null;
814                    }
815    
816                    groupCacheModel.site = getSite();
817    
818                    groupCacheModel.active = getActive();
819    
820                    return groupCacheModel;
821            }
822    
823            @Override
824            public String toString() {
825                    StringBundler sb = new StringBundler(29);
826    
827                    sb.append("{groupId=");
828                    sb.append(getGroupId());
829                    sb.append(", companyId=");
830                    sb.append(getCompanyId());
831                    sb.append(", creatorUserId=");
832                    sb.append(getCreatorUserId());
833                    sb.append(", classNameId=");
834                    sb.append(getClassNameId());
835                    sb.append(", classPK=");
836                    sb.append(getClassPK());
837                    sb.append(", parentGroupId=");
838                    sb.append(getParentGroupId());
839                    sb.append(", liveGroupId=");
840                    sb.append(getLiveGroupId());
841                    sb.append(", name=");
842                    sb.append(getName());
843                    sb.append(", description=");
844                    sb.append(getDescription());
845                    sb.append(", type=");
846                    sb.append(getType());
847                    sb.append(", typeSettings=");
848                    sb.append(getTypeSettings());
849                    sb.append(", friendlyURL=");
850                    sb.append(getFriendlyURL());
851                    sb.append(", site=");
852                    sb.append(getSite());
853                    sb.append(", active=");
854                    sb.append(getActive());
855                    sb.append("}");
856    
857                    return sb.toString();
858            }
859    
860            public String toXmlString() {
861                    StringBundler sb = new StringBundler(46);
862    
863                    sb.append("<model><model-name>");
864                    sb.append("com.liferay.portal.model.Group");
865                    sb.append("</model-name>");
866    
867                    sb.append(
868                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
869                    sb.append(getGroupId());
870                    sb.append("]]></column-value></column>");
871                    sb.append(
872                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
873                    sb.append(getCompanyId());
874                    sb.append("]]></column-value></column>");
875                    sb.append(
876                            "<column><column-name>creatorUserId</column-name><column-value><![CDATA[");
877                    sb.append(getCreatorUserId());
878                    sb.append("]]></column-value></column>");
879                    sb.append(
880                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
881                    sb.append(getClassNameId());
882                    sb.append("]]></column-value></column>");
883                    sb.append(
884                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
885                    sb.append(getClassPK());
886                    sb.append("]]></column-value></column>");
887                    sb.append(
888                            "<column><column-name>parentGroupId</column-name><column-value><![CDATA[");
889                    sb.append(getParentGroupId());
890                    sb.append("]]></column-value></column>");
891                    sb.append(
892                            "<column><column-name>liveGroupId</column-name><column-value><![CDATA[");
893                    sb.append(getLiveGroupId());
894                    sb.append("]]></column-value></column>");
895                    sb.append(
896                            "<column><column-name>name</column-name><column-value><![CDATA[");
897                    sb.append(getName());
898                    sb.append("]]></column-value></column>");
899                    sb.append(
900                            "<column><column-name>description</column-name><column-value><![CDATA[");
901                    sb.append(getDescription());
902                    sb.append("]]></column-value></column>");
903                    sb.append(
904                            "<column><column-name>type</column-name><column-value><![CDATA[");
905                    sb.append(getType());
906                    sb.append("]]></column-value></column>");
907                    sb.append(
908                            "<column><column-name>typeSettings</column-name><column-value><![CDATA[");
909                    sb.append(getTypeSettings());
910                    sb.append("]]></column-value></column>");
911                    sb.append(
912                            "<column><column-name>friendlyURL</column-name><column-value><![CDATA[");
913                    sb.append(getFriendlyURL());
914                    sb.append("]]></column-value></column>");
915                    sb.append(
916                            "<column><column-name>site</column-name><column-value><![CDATA[");
917                    sb.append(getSite());
918                    sb.append("]]></column-value></column>");
919                    sb.append(
920                            "<column><column-name>active</column-name><column-value><![CDATA[");
921                    sb.append(getActive());
922                    sb.append("]]></column-value></column>");
923    
924                    sb.append("</model>");
925    
926                    return sb.toString();
927            }
928    
929            private static ClassLoader _classLoader = Group.class.getClassLoader();
930            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
931                            Group.class
932                    };
933            private long _groupId;
934            private long _companyId;
935            private long _originalCompanyId;
936            private boolean _setOriginalCompanyId;
937            private long _creatorUserId;
938            private String _creatorUserUuid;
939            private long _classNameId;
940            private long _originalClassNameId;
941            private boolean _setOriginalClassNameId;
942            private long _classPK;
943            private long _originalClassPK;
944            private boolean _setOriginalClassPK;
945            private long _parentGroupId;
946            private long _originalParentGroupId;
947            private boolean _setOriginalParentGroupId;
948            private long _liveGroupId;
949            private long _originalLiveGroupId;
950            private boolean _setOriginalLiveGroupId;
951            private String _name;
952            private String _originalName;
953            private String _description;
954            private int _type;
955            private int _originalType;
956            private boolean _setOriginalType;
957            private String _typeSettings;
958            private String _friendlyURL;
959            private String _originalFriendlyURL;
960            private boolean _site;
961            private boolean _originalSite;
962            private boolean _setOriginalSite;
963            private boolean _active;
964            private boolean _originalActive;
965            private boolean _setOriginalActive;
966            private long _columnBitmask;
967            private Group _escapedModelProxy;
968    }