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