001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.exception.NoSuchModelException;
020    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
021    import com.liferay.portal.kernel.exception.PortalException;
022    import com.liferay.portal.kernel.json.JSON;
023    import com.liferay.portal.kernel.trash.TrashHandler;
024    import com.liferay.portal.kernel.trash.TrashHandlerRegistryUtil;
025    import com.liferay.portal.kernel.util.DateUtil;
026    import com.liferay.portal.kernel.util.GetterUtil;
027    import com.liferay.portal.kernel.util.ProxyUtil;
028    import com.liferay.portal.kernel.util.StringBundler;
029    import com.liferay.portal.kernel.util.StringPool;
030    import com.liferay.portal.kernel.util.Validator;
031    import com.liferay.portal.kernel.workflow.WorkflowConstants;
032    import com.liferay.portal.model.CacheModel;
033    import com.liferay.portal.model.ContainerModel;
034    import com.liferay.portal.model.TrashedModel;
035    import com.liferay.portal.model.User;
036    import com.liferay.portal.model.impl.BaseModelImpl;
037    import com.liferay.portal.service.ServiceContext;
038    import com.liferay.portal.service.UserLocalServiceUtil;
039    import com.liferay.portal.util.PortalUtil;
040    
041    import com.liferay.portlet.expando.model.ExpandoBridge;
042    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
043    import com.liferay.portlet.exportimport.lar.StagedModelType;
044    import com.liferay.portlet.messageboards.model.MBThread;
045    import com.liferay.portlet.messageboards.model.MBThreadModel;
046    import com.liferay.portlet.messageboards.model.MBThreadSoap;
047    import com.liferay.portlet.trash.model.TrashEntry;
048    import com.liferay.portlet.trash.service.TrashEntryLocalServiceUtil;
049    
050    import java.io.Serializable;
051    
052    import java.sql.Types;
053    
054    import java.util.ArrayList;
055    import java.util.Date;
056    import java.util.HashMap;
057    import java.util.List;
058    import java.util.Map;
059    
060    /**
061     * The base model implementation for the MBThread service. Represents a row in the "MBThread" database table, with each column mapped to a property of this class.
062     *
063     * <p>
064     * This implementation and its corresponding interface {@link MBThreadModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link MBThreadImpl}.
065     * </p>
066     *
067     * @author Brian Wing Shun Chan
068     * @see MBThreadImpl
069     * @see MBThread
070     * @see MBThreadModel
071     * @generated
072     */
073    @JSON(strict = true)
074    @ProviderType
075    public class MBThreadModelImpl extends BaseModelImpl<MBThread>
076            implements MBThreadModel {
077            /*
078             * NOTE FOR DEVELOPERS:
079             *
080             * Never modify or reference this class directly. All methods that expect a message boards thread model instance should use the {@link MBThread} interface instead.
081             */
082            public static final String TABLE_NAME = "MBThread";
083            public static final Object[][] TABLE_COLUMNS = {
084                            { "uuid_", Types.VARCHAR },
085                            { "threadId", Types.BIGINT },
086                            { "groupId", Types.BIGINT },
087                            { "companyId", Types.BIGINT },
088                            { "userId", Types.BIGINT },
089                            { "userName", Types.VARCHAR },
090                            { "createDate", Types.TIMESTAMP },
091                            { "modifiedDate", Types.TIMESTAMP },
092                            { "categoryId", Types.BIGINT },
093                            { "rootMessageId", Types.BIGINT },
094                            { "rootMessageUserId", Types.BIGINT },
095                            { "messageCount", Types.INTEGER },
096                            { "viewCount", Types.INTEGER },
097                            { "lastPostByUserId", Types.BIGINT },
098                            { "lastPostDate", Types.TIMESTAMP },
099                            { "priority", Types.DOUBLE },
100                            { "question", Types.BOOLEAN },
101                            { "lastPublishDate", Types.TIMESTAMP },
102                            { "status", Types.INTEGER },
103                            { "statusByUserId", Types.BIGINT },
104                            { "statusByUserName", Types.VARCHAR },
105                            { "statusDate", Types.TIMESTAMP }
106                    };
107            public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>();
108    
109            static {
110                    TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR);
111                    TABLE_COLUMNS_MAP.put("threadId", Types.BIGINT);
112                    TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT);
113                    TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
114                    TABLE_COLUMNS_MAP.put("userId", Types.BIGINT);
115                    TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR);
116                    TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP);
117                    TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP);
118                    TABLE_COLUMNS_MAP.put("categoryId", Types.BIGINT);
119                    TABLE_COLUMNS_MAP.put("rootMessageId", Types.BIGINT);
120                    TABLE_COLUMNS_MAP.put("rootMessageUserId", Types.BIGINT);
121                    TABLE_COLUMNS_MAP.put("messageCount", Types.INTEGER);
122                    TABLE_COLUMNS_MAP.put("viewCount", Types.INTEGER);
123                    TABLE_COLUMNS_MAP.put("lastPostByUserId", Types.BIGINT);
124                    TABLE_COLUMNS_MAP.put("lastPostDate", Types.TIMESTAMP);
125                    TABLE_COLUMNS_MAP.put("priority", Types.DOUBLE);
126                    TABLE_COLUMNS_MAP.put("question", Types.BOOLEAN);
127                    TABLE_COLUMNS_MAP.put("lastPublishDate", Types.TIMESTAMP);
128                    TABLE_COLUMNS_MAP.put("status", Types.INTEGER);
129                    TABLE_COLUMNS_MAP.put("statusByUserId", Types.BIGINT);
130                    TABLE_COLUMNS_MAP.put("statusByUserName", Types.VARCHAR);
131                    TABLE_COLUMNS_MAP.put("statusDate", Types.TIMESTAMP);
132            }
133    
134            public static final String TABLE_SQL_CREATE = "create table MBThread (uuid_ VARCHAR(75) null,threadId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,categoryId LONG,rootMessageId LONG,rootMessageUserId LONG,messageCount INTEGER,viewCount INTEGER,lastPostByUserId LONG,lastPostDate DATE null,priority DOUBLE,question BOOLEAN,lastPublishDate DATE null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
135            public static final String TABLE_SQL_DROP = "drop table MBThread";
136            public static final String ORDER_BY_JPQL = " ORDER BY mbThread.priority DESC, mbThread.lastPostDate DESC";
137            public static final String ORDER_BY_SQL = " ORDER BY MBThread.priority DESC, MBThread.lastPostDate DESC";
138            public static final String DATA_SOURCE = "liferayDataSource";
139            public static final String SESSION_FACTORY = "liferaySessionFactory";
140            public static final String TX_MANAGER = "liferayTransactionManager";
141            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
142                                    "value.object.entity.cache.enabled.com.liferay.portlet.messageboards.model.MBThread"),
143                            true);
144            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
145                                    "value.object.finder.cache.enabled.com.liferay.portlet.messageboards.model.MBThread"),
146                            true);
147            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
148                                    "value.object.column.bitmask.enabled.com.liferay.portlet.messageboards.model.MBThread"),
149                            true);
150            public static final long CATEGORYID_COLUMN_BITMASK = 1L;
151            public static final long COMPANYID_COLUMN_BITMASK = 2L;
152            public static final long GROUPID_COLUMN_BITMASK = 4L;
153            public static final long LASTPOSTDATE_COLUMN_BITMASK = 8L;
154            public static final long PRIORITY_COLUMN_BITMASK = 16L;
155            public static final long ROOTMESSAGEID_COLUMN_BITMASK = 32L;
156            public static final long STATUS_COLUMN_BITMASK = 64L;
157            public static final long UUID_COLUMN_BITMASK = 128L;
158    
159            /**
160             * Converts the soap model instance into a normal model instance.
161             *
162             * @param soapModel the soap model instance to convert
163             * @return the normal model instance
164             */
165            public static MBThread toModel(MBThreadSoap soapModel) {
166                    if (soapModel == null) {
167                            return null;
168                    }
169    
170                    MBThread model = new MBThreadImpl();
171    
172                    model.setUuid(soapModel.getUuid());
173                    model.setThreadId(soapModel.getThreadId());
174                    model.setGroupId(soapModel.getGroupId());
175                    model.setCompanyId(soapModel.getCompanyId());
176                    model.setUserId(soapModel.getUserId());
177                    model.setUserName(soapModel.getUserName());
178                    model.setCreateDate(soapModel.getCreateDate());
179                    model.setModifiedDate(soapModel.getModifiedDate());
180                    model.setCategoryId(soapModel.getCategoryId());
181                    model.setRootMessageId(soapModel.getRootMessageId());
182                    model.setRootMessageUserId(soapModel.getRootMessageUserId());
183                    model.setMessageCount(soapModel.getMessageCount());
184                    model.setViewCount(soapModel.getViewCount());
185                    model.setLastPostByUserId(soapModel.getLastPostByUserId());
186                    model.setLastPostDate(soapModel.getLastPostDate());
187                    model.setPriority(soapModel.getPriority());
188                    model.setQuestion(soapModel.getQuestion());
189                    model.setLastPublishDate(soapModel.getLastPublishDate());
190                    model.setStatus(soapModel.getStatus());
191                    model.setStatusByUserId(soapModel.getStatusByUserId());
192                    model.setStatusByUserName(soapModel.getStatusByUserName());
193                    model.setStatusDate(soapModel.getStatusDate());
194    
195                    return model;
196            }
197    
198            /**
199             * Converts the soap model instances into normal model instances.
200             *
201             * @param soapModels the soap model instances to convert
202             * @return the normal model instances
203             */
204            public static List<MBThread> toModels(MBThreadSoap[] soapModels) {
205                    if (soapModels == null) {
206                            return null;
207                    }
208    
209                    List<MBThread> models = new ArrayList<MBThread>(soapModels.length);
210    
211                    for (MBThreadSoap soapModel : soapModels) {
212                            models.add(toModel(soapModel));
213                    }
214    
215                    return models;
216            }
217    
218            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
219                                    "lock.expiration.time.com.liferay.portlet.messageboards.model.MBThread"));
220    
221            public MBThreadModelImpl() {
222            }
223    
224            @Override
225            public long getPrimaryKey() {
226                    return _threadId;
227            }
228    
229            @Override
230            public void setPrimaryKey(long primaryKey) {
231                    setThreadId(primaryKey);
232            }
233    
234            @Override
235            public Serializable getPrimaryKeyObj() {
236                    return _threadId;
237            }
238    
239            @Override
240            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
241                    setPrimaryKey(((Long)primaryKeyObj).longValue());
242            }
243    
244            @Override
245            public Class<?> getModelClass() {
246                    return MBThread.class;
247            }
248    
249            @Override
250            public String getModelClassName() {
251                    return MBThread.class.getName();
252            }
253    
254            @Override
255            public Map<String, Object> getModelAttributes() {
256                    Map<String, Object> attributes = new HashMap<String, Object>();
257    
258                    attributes.put("uuid", getUuid());
259                    attributes.put("threadId", getThreadId());
260                    attributes.put("groupId", getGroupId());
261                    attributes.put("companyId", getCompanyId());
262                    attributes.put("userId", getUserId());
263                    attributes.put("userName", getUserName());
264                    attributes.put("createDate", getCreateDate());
265                    attributes.put("modifiedDate", getModifiedDate());
266                    attributes.put("categoryId", getCategoryId());
267                    attributes.put("rootMessageId", getRootMessageId());
268                    attributes.put("rootMessageUserId", getRootMessageUserId());
269                    attributes.put("messageCount", getMessageCount());
270                    attributes.put("viewCount", getViewCount());
271                    attributes.put("lastPostByUserId", getLastPostByUserId());
272                    attributes.put("lastPostDate", getLastPostDate());
273                    attributes.put("priority", getPriority());
274                    attributes.put("question", getQuestion());
275                    attributes.put("lastPublishDate", getLastPublishDate());
276                    attributes.put("status", getStatus());
277                    attributes.put("statusByUserId", getStatusByUserId());
278                    attributes.put("statusByUserName", getStatusByUserName());
279                    attributes.put("statusDate", getStatusDate());
280    
281                    attributes.put("entityCacheEnabled", isEntityCacheEnabled());
282                    attributes.put("finderCacheEnabled", isFinderCacheEnabled());
283    
284                    return attributes;
285            }
286    
287            @Override
288            public void setModelAttributes(Map<String, Object> attributes) {
289                    String uuid = (String)attributes.get("uuid");
290    
291                    if (uuid != null) {
292                            setUuid(uuid);
293                    }
294    
295                    Long threadId = (Long)attributes.get("threadId");
296    
297                    if (threadId != null) {
298                            setThreadId(threadId);
299                    }
300    
301                    Long groupId = (Long)attributes.get("groupId");
302    
303                    if (groupId != null) {
304                            setGroupId(groupId);
305                    }
306    
307                    Long companyId = (Long)attributes.get("companyId");
308    
309                    if (companyId != null) {
310                            setCompanyId(companyId);
311                    }
312    
313                    Long userId = (Long)attributes.get("userId");
314    
315                    if (userId != null) {
316                            setUserId(userId);
317                    }
318    
319                    String userName = (String)attributes.get("userName");
320    
321                    if (userName != null) {
322                            setUserName(userName);
323                    }
324    
325                    Date createDate = (Date)attributes.get("createDate");
326    
327                    if (createDate != null) {
328                            setCreateDate(createDate);
329                    }
330    
331                    Date modifiedDate = (Date)attributes.get("modifiedDate");
332    
333                    if (modifiedDate != null) {
334                            setModifiedDate(modifiedDate);
335                    }
336    
337                    Long categoryId = (Long)attributes.get("categoryId");
338    
339                    if (categoryId != null) {
340                            setCategoryId(categoryId);
341                    }
342    
343                    Long rootMessageId = (Long)attributes.get("rootMessageId");
344    
345                    if (rootMessageId != null) {
346                            setRootMessageId(rootMessageId);
347                    }
348    
349                    Long rootMessageUserId = (Long)attributes.get("rootMessageUserId");
350    
351                    if (rootMessageUserId != null) {
352                            setRootMessageUserId(rootMessageUserId);
353                    }
354    
355                    Integer messageCount = (Integer)attributes.get("messageCount");
356    
357                    if (messageCount != null) {
358                            setMessageCount(messageCount);
359                    }
360    
361                    Integer viewCount = (Integer)attributes.get("viewCount");
362    
363                    if (viewCount != null) {
364                            setViewCount(viewCount);
365                    }
366    
367                    Long lastPostByUserId = (Long)attributes.get("lastPostByUserId");
368    
369                    if (lastPostByUserId != null) {
370                            setLastPostByUserId(lastPostByUserId);
371                    }
372    
373                    Date lastPostDate = (Date)attributes.get("lastPostDate");
374    
375                    if (lastPostDate != null) {
376                            setLastPostDate(lastPostDate);
377                    }
378    
379                    Double priority = (Double)attributes.get("priority");
380    
381                    if (priority != null) {
382                            setPriority(priority);
383                    }
384    
385                    Boolean question = (Boolean)attributes.get("question");
386    
387                    if (question != null) {
388                            setQuestion(question);
389                    }
390    
391                    Date lastPublishDate = (Date)attributes.get("lastPublishDate");
392    
393                    if (lastPublishDate != null) {
394                            setLastPublishDate(lastPublishDate);
395                    }
396    
397                    Integer status = (Integer)attributes.get("status");
398    
399                    if (status != null) {
400                            setStatus(status);
401                    }
402    
403                    Long statusByUserId = (Long)attributes.get("statusByUserId");
404    
405                    if (statusByUserId != null) {
406                            setStatusByUserId(statusByUserId);
407                    }
408    
409                    String statusByUserName = (String)attributes.get("statusByUserName");
410    
411                    if (statusByUserName != null) {
412                            setStatusByUserName(statusByUserName);
413                    }
414    
415                    Date statusDate = (Date)attributes.get("statusDate");
416    
417                    if (statusDate != null) {
418                            setStatusDate(statusDate);
419                    }
420            }
421    
422            @JSON
423            @Override
424            public String getUuid() {
425                    if (_uuid == null) {
426                            return StringPool.BLANK;
427                    }
428                    else {
429                            return _uuid;
430                    }
431            }
432    
433            @Override
434            public void setUuid(String uuid) {
435                    if (_originalUuid == null) {
436                            _originalUuid = _uuid;
437                    }
438    
439                    _uuid = uuid;
440            }
441    
442            public String getOriginalUuid() {
443                    return GetterUtil.getString(_originalUuid);
444            }
445    
446            @JSON
447            @Override
448            public long getThreadId() {
449                    return _threadId;
450            }
451    
452            @Override
453            public void setThreadId(long threadId) {
454                    _threadId = threadId;
455            }
456    
457            @JSON
458            @Override
459            public long getGroupId() {
460                    return _groupId;
461            }
462    
463            @Override
464            public void setGroupId(long groupId) {
465                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
466    
467                    if (!_setOriginalGroupId) {
468                            _setOriginalGroupId = true;
469    
470                            _originalGroupId = _groupId;
471                    }
472    
473                    _groupId = groupId;
474            }
475    
476            public long getOriginalGroupId() {
477                    return _originalGroupId;
478            }
479    
480            @JSON
481            @Override
482            public long getCompanyId() {
483                    return _companyId;
484            }
485    
486            @Override
487            public void setCompanyId(long companyId) {
488                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
489    
490                    if (!_setOriginalCompanyId) {
491                            _setOriginalCompanyId = true;
492    
493                            _originalCompanyId = _companyId;
494                    }
495    
496                    _companyId = companyId;
497            }
498    
499            public long getOriginalCompanyId() {
500                    return _originalCompanyId;
501            }
502    
503            @JSON
504            @Override
505            public long getUserId() {
506                    return _userId;
507            }
508    
509            @Override
510            public void setUserId(long userId) {
511                    _userId = userId;
512            }
513    
514            @Override
515            public String getUserUuid() {
516                    try {
517                            User user = UserLocalServiceUtil.getUserById(getUserId());
518    
519                            return user.getUuid();
520                    }
521                    catch (PortalException pe) {
522                            return StringPool.BLANK;
523                    }
524            }
525    
526            @Override
527            public void setUserUuid(String userUuid) {
528            }
529    
530            @JSON
531            @Override
532            public String getUserName() {
533                    if (_userName == null) {
534                            return StringPool.BLANK;
535                    }
536                    else {
537                            return _userName;
538                    }
539            }
540    
541            @Override
542            public void setUserName(String userName) {
543                    _userName = userName;
544            }
545    
546            @JSON
547            @Override
548            public Date getCreateDate() {
549                    return _createDate;
550            }
551    
552            @Override
553            public void setCreateDate(Date createDate) {
554                    _createDate = createDate;
555            }
556    
557            @JSON
558            @Override
559            public Date getModifiedDate() {
560                    return _modifiedDate;
561            }
562    
563            public boolean hasSetModifiedDate() {
564                    return _setModifiedDate;
565            }
566    
567            @Override
568            public void setModifiedDate(Date modifiedDate) {
569                    _setModifiedDate = true;
570    
571                    _modifiedDate = modifiedDate;
572            }
573    
574            @JSON
575            @Override
576            public long getCategoryId() {
577                    return _categoryId;
578            }
579    
580            @Override
581            public void setCategoryId(long categoryId) {
582                    _columnBitmask |= CATEGORYID_COLUMN_BITMASK;
583    
584                    if (!_setOriginalCategoryId) {
585                            _setOriginalCategoryId = true;
586    
587                            _originalCategoryId = _categoryId;
588                    }
589    
590                    _categoryId = categoryId;
591            }
592    
593            public long getOriginalCategoryId() {
594                    return _originalCategoryId;
595            }
596    
597            @JSON
598            @Override
599            public long getRootMessageId() {
600                    return _rootMessageId;
601            }
602    
603            @Override
604            public void setRootMessageId(long rootMessageId) {
605                    _columnBitmask |= ROOTMESSAGEID_COLUMN_BITMASK;
606    
607                    if (!_setOriginalRootMessageId) {
608                            _setOriginalRootMessageId = true;
609    
610                            _originalRootMessageId = _rootMessageId;
611                    }
612    
613                    _rootMessageId = rootMessageId;
614            }
615    
616            public long getOriginalRootMessageId() {
617                    return _originalRootMessageId;
618            }
619    
620            @JSON
621            @Override
622            public long getRootMessageUserId() {
623                    return _rootMessageUserId;
624            }
625    
626            @Override
627            public void setRootMessageUserId(long rootMessageUserId) {
628                    _rootMessageUserId = rootMessageUserId;
629            }
630    
631            @Override
632            public String getRootMessageUserUuid() {
633                    try {
634                            User user = UserLocalServiceUtil.getUserById(getRootMessageUserId());
635    
636                            return user.getUuid();
637                    }
638                    catch (PortalException pe) {
639                            return StringPool.BLANK;
640                    }
641            }
642    
643            @Override
644            public void setRootMessageUserUuid(String rootMessageUserUuid) {
645            }
646    
647            @JSON
648            @Override
649            public int getMessageCount() {
650                    return _messageCount;
651            }
652    
653            @Override
654            public void setMessageCount(int messageCount) {
655                    _messageCount = messageCount;
656            }
657    
658            @JSON
659            @Override
660            public int getViewCount() {
661                    return _viewCount;
662            }
663    
664            @Override
665            public void setViewCount(int viewCount) {
666                    _viewCount = viewCount;
667            }
668    
669            @JSON
670            @Override
671            public long getLastPostByUserId() {
672                    return _lastPostByUserId;
673            }
674    
675            @Override
676            public void setLastPostByUserId(long lastPostByUserId) {
677                    _lastPostByUserId = lastPostByUserId;
678            }
679    
680            @Override
681            public String getLastPostByUserUuid() {
682                    try {
683                            User user = UserLocalServiceUtil.getUserById(getLastPostByUserId());
684    
685                            return user.getUuid();
686                    }
687                    catch (PortalException pe) {
688                            return StringPool.BLANK;
689                    }
690            }
691    
692            @Override
693            public void setLastPostByUserUuid(String lastPostByUserUuid) {
694            }
695    
696            @JSON
697            @Override
698            public Date getLastPostDate() {
699                    return _lastPostDate;
700            }
701    
702            @Override
703            public void setLastPostDate(Date lastPostDate) {
704                    _columnBitmask = -1L;
705    
706                    if (_originalLastPostDate == null) {
707                            _originalLastPostDate = _lastPostDate;
708                    }
709    
710                    _lastPostDate = lastPostDate;
711            }
712    
713            public Date getOriginalLastPostDate() {
714                    return _originalLastPostDate;
715            }
716    
717            @JSON
718            @Override
719            public double getPriority() {
720                    return _priority;
721            }
722    
723            @Override
724            public void setPriority(double priority) {
725                    _columnBitmask = -1L;
726    
727                    if (!_setOriginalPriority) {
728                            _setOriginalPriority = true;
729    
730                            _originalPriority = _priority;
731                    }
732    
733                    _priority = priority;
734            }
735    
736            public double getOriginalPriority() {
737                    return _originalPriority;
738            }
739    
740            @JSON
741            @Override
742            public boolean getQuestion() {
743                    return _question;
744            }
745    
746            @Override
747            public boolean isQuestion() {
748                    return _question;
749            }
750    
751            @Override
752            public void setQuestion(boolean question) {
753                    _question = question;
754            }
755    
756            @JSON
757            @Override
758            public Date getLastPublishDate() {
759                    return _lastPublishDate;
760            }
761    
762            @Override
763            public void setLastPublishDate(Date lastPublishDate) {
764                    _lastPublishDate = lastPublishDate;
765            }
766    
767            @JSON
768            @Override
769            public int getStatus() {
770                    return _status;
771            }
772    
773            @Override
774            public void setStatus(int status) {
775                    _columnBitmask |= STATUS_COLUMN_BITMASK;
776    
777                    if (!_setOriginalStatus) {
778                            _setOriginalStatus = true;
779    
780                            _originalStatus = _status;
781                    }
782    
783                    _status = status;
784            }
785    
786            public int getOriginalStatus() {
787                    return _originalStatus;
788            }
789    
790            @JSON
791            @Override
792            public long getStatusByUserId() {
793                    return _statusByUserId;
794            }
795    
796            @Override
797            public void setStatusByUserId(long statusByUserId) {
798                    _statusByUserId = statusByUserId;
799            }
800    
801            @Override
802            public String getStatusByUserUuid() {
803                    try {
804                            User user = UserLocalServiceUtil.getUserById(getStatusByUserId());
805    
806                            return user.getUuid();
807                    }
808                    catch (PortalException pe) {
809                            return StringPool.BLANK;
810                    }
811            }
812    
813            @Override
814            public void setStatusByUserUuid(String statusByUserUuid) {
815            }
816    
817            @JSON
818            @Override
819            public String getStatusByUserName() {
820                    if (_statusByUserName == null) {
821                            return StringPool.BLANK;
822                    }
823                    else {
824                            return _statusByUserName;
825                    }
826            }
827    
828            @Override
829            public void setStatusByUserName(String statusByUserName) {
830                    _statusByUserName = statusByUserName;
831            }
832    
833            @JSON
834            @Override
835            public Date getStatusDate() {
836                    return _statusDate;
837            }
838    
839            @Override
840            public void setStatusDate(Date statusDate) {
841                    _statusDate = statusDate;
842            }
843    
844            @Override
845            public long getContainerModelId() {
846                    return getThreadId();
847            }
848    
849            @Override
850            public void setContainerModelId(long containerModelId) {
851                    _threadId = containerModelId;
852            }
853    
854            @Override
855            public long getParentContainerModelId() {
856                    return getCategoryId();
857            }
858    
859            @Override
860            public void setParentContainerModelId(long parentContainerModelId) {
861                    _categoryId = parentContainerModelId;
862            }
863    
864            @Override
865            public String getContainerModelName() {
866                    return String.valueOf(getContainerModelId());
867            }
868    
869            @Override
870            public StagedModelType getStagedModelType() {
871                    return new StagedModelType(PortalUtil.getClassNameId(
872                                    MBThread.class.getName()));
873            }
874    
875            @Override
876            public TrashEntry getTrashEntry() throws PortalException {
877                    if (!isInTrash()) {
878                            return null;
879                    }
880    
881                    TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
882                                    getTrashEntryClassPK());
883    
884                    if (trashEntry != null) {
885                            return trashEntry;
886                    }
887    
888                    TrashHandler trashHandler = getTrashHandler();
889    
890                    if (!Validator.isNull(trashHandler.getContainerModelClassName(
891                                                    getPrimaryKey()))) {
892                            ContainerModel containerModel = null;
893    
894                            try {
895                                    containerModel = trashHandler.getParentContainerModel(this);
896                            }
897                            catch (NoSuchModelException nsme) {
898                                    return null;
899                            }
900    
901                            while (containerModel != null) {
902                                    if (containerModel instanceof TrashedModel) {
903                                            TrashedModel trashedModel = (TrashedModel)containerModel;
904    
905                                            return trashedModel.getTrashEntry();
906                                    }
907    
908                                    trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName(
909                                                            containerModel.getContainerModelId()));
910    
911                                    if (trashHandler == null) {
912                                            return null;
913                                    }
914    
915                                    containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
916                            }
917                    }
918    
919                    return null;
920            }
921    
922            @Override
923            public long getTrashEntryClassPK() {
924                    return getPrimaryKey();
925            }
926    
927            @Override
928            public TrashHandler getTrashHandler() {
929                    return TrashHandlerRegistryUtil.getTrashHandler(getModelClassName());
930            }
931    
932            @Override
933            public boolean isInTrash() {
934                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
935                            return true;
936                    }
937                    else {
938                            return false;
939                    }
940            }
941    
942            @Override
943            public boolean isInTrashContainer() {
944                    TrashHandler trashHandler = getTrashHandler();
945    
946                    if ((trashHandler == null) ||
947                                    Validator.isNull(trashHandler.getContainerModelClassName(
948                                                    getPrimaryKey()))) {
949                            return false;
950                    }
951    
952                    try {
953                            ContainerModel containerModel = trashHandler.getParentContainerModel(this);
954    
955                            if (containerModel == null) {
956                                    return false;
957                            }
958    
959                            if (containerModel instanceof TrashedModel) {
960                                    return ((TrashedModel)containerModel).isInTrash();
961                            }
962                    }
963                    catch (Exception e) {
964                    }
965    
966                    return false;
967            }
968    
969            @Override
970            public boolean isInTrashExplicitly() {
971                    if (!isInTrash()) {
972                            return false;
973                    }
974    
975                    TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
976                                    getTrashEntryClassPK());
977    
978                    if (trashEntry != null) {
979                            return true;
980                    }
981    
982                    return false;
983            }
984    
985            @Override
986            public boolean isInTrashImplicitly() {
987                    if (!isInTrash()) {
988                            return false;
989                    }
990    
991                    TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(),
992                                    getTrashEntryClassPK());
993    
994                    if (trashEntry != null) {
995                            return false;
996                    }
997    
998                    return true;
999            }
1000    
1001            @Override
1002            public boolean isApproved() {
1003                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
1004                            return true;
1005                    }
1006                    else {
1007                            return false;
1008                    }
1009            }
1010    
1011            @Override
1012            public boolean isDenied() {
1013                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
1014                            return true;
1015                    }
1016                    else {
1017                            return false;
1018                    }
1019            }
1020    
1021            @Override
1022            public boolean isDraft() {
1023                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
1024                            return true;
1025                    }
1026                    else {
1027                            return false;
1028                    }
1029            }
1030    
1031            @Override
1032            public boolean isExpired() {
1033                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
1034                            return true;
1035                    }
1036                    else {
1037                            return false;
1038                    }
1039            }
1040    
1041            @Override
1042            public boolean isInactive() {
1043                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
1044                            return true;
1045                    }
1046                    else {
1047                            return false;
1048                    }
1049            }
1050    
1051            @Override
1052            public boolean isIncomplete() {
1053                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
1054                            return true;
1055                    }
1056                    else {
1057                            return false;
1058                    }
1059            }
1060    
1061            @Override
1062            public boolean isPending() {
1063                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
1064                            return true;
1065                    }
1066                    else {
1067                            return false;
1068                    }
1069            }
1070    
1071            @Override
1072            public boolean isScheduled() {
1073                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
1074                            return true;
1075                    }
1076                    else {
1077                            return false;
1078                    }
1079            }
1080    
1081            public long getColumnBitmask() {
1082                    return _columnBitmask;
1083            }
1084    
1085            @Override
1086            public ExpandoBridge getExpandoBridge() {
1087                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
1088                            MBThread.class.getName(), getPrimaryKey());
1089            }
1090    
1091            @Override
1092            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
1093                    ExpandoBridge expandoBridge = getExpandoBridge();
1094    
1095                    expandoBridge.setAttributes(serviceContext);
1096            }
1097    
1098            @Override
1099            public MBThread toEscapedModel() {
1100                    if (_escapedModel == null) {
1101                            _escapedModel = (MBThread)ProxyUtil.newProxyInstance(_classLoader,
1102                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
1103                    }
1104    
1105                    return _escapedModel;
1106            }
1107    
1108            @Override
1109            public Object clone() {
1110                    MBThreadImpl mbThreadImpl = new MBThreadImpl();
1111    
1112                    mbThreadImpl.setUuid(getUuid());
1113                    mbThreadImpl.setThreadId(getThreadId());
1114                    mbThreadImpl.setGroupId(getGroupId());
1115                    mbThreadImpl.setCompanyId(getCompanyId());
1116                    mbThreadImpl.setUserId(getUserId());
1117                    mbThreadImpl.setUserName(getUserName());
1118                    mbThreadImpl.setCreateDate(getCreateDate());
1119                    mbThreadImpl.setModifiedDate(getModifiedDate());
1120                    mbThreadImpl.setCategoryId(getCategoryId());
1121                    mbThreadImpl.setRootMessageId(getRootMessageId());
1122                    mbThreadImpl.setRootMessageUserId(getRootMessageUserId());
1123                    mbThreadImpl.setMessageCount(getMessageCount());
1124                    mbThreadImpl.setViewCount(getViewCount());
1125                    mbThreadImpl.setLastPostByUserId(getLastPostByUserId());
1126                    mbThreadImpl.setLastPostDate(getLastPostDate());
1127                    mbThreadImpl.setPriority(getPriority());
1128                    mbThreadImpl.setQuestion(getQuestion());
1129                    mbThreadImpl.setLastPublishDate(getLastPublishDate());
1130                    mbThreadImpl.setStatus(getStatus());
1131                    mbThreadImpl.setStatusByUserId(getStatusByUserId());
1132                    mbThreadImpl.setStatusByUserName(getStatusByUserName());
1133                    mbThreadImpl.setStatusDate(getStatusDate());
1134    
1135                    mbThreadImpl.resetOriginalValues();
1136    
1137                    return mbThreadImpl;
1138            }
1139    
1140            @Override
1141            public int compareTo(MBThread mbThread) {
1142                    int value = 0;
1143    
1144                    if (getPriority() < mbThread.getPriority()) {
1145                            value = -1;
1146                    }
1147                    else if (getPriority() > mbThread.getPriority()) {
1148                            value = 1;
1149                    }
1150                    else {
1151                            value = 0;
1152                    }
1153    
1154                    value = value * -1;
1155    
1156                    if (value != 0) {
1157                            return value;
1158                    }
1159    
1160                    value = DateUtil.compareTo(getLastPostDate(), mbThread.getLastPostDate());
1161    
1162                    value = value * -1;
1163    
1164                    if (value != 0) {
1165                            return value;
1166                    }
1167    
1168                    return 0;
1169            }
1170    
1171            @Override
1172            public boolean equals(Object obj) {
1173                    if (this == obj) {
1174                            return true;
1175                    }
1176    
1177                    if (!(obj instanceof MBThread)) {
1178                            return false;
1179                    }
1180    
1181                    MBThread mbThread = (MBThread)obj;
1182    
1183                    long primaryKey = mbThread.getPrimaryKey();
1184    
1185                    if (getPrimaryKey() == primaryKey) {
1186                            return true;
1187                    }
1188                    else {
1189                            return false;
1190                    }
1191            }
1192    
1193            @Override
1194            public int hashCode() {
1195                    return (int)getPrimaryKey();
1196            }
1197    
1198            @Override
1199            public boolean isEntityCacheEnabled() {
1200                    return ENTITY_CACHE_ENABLED;
1201            }
1202    
1203            @Override
1204            public boolean isFinderCacheEnabled() {
1205                    return FINDER_CACHE_ENABLED;
1206            }
1207    
1208            @Override
1209            public void resetOriginalValues() {
1210                    MBThreadModelImpl mbThreadModelImpl = this;
1211    
1212                    mbThreadModelImpl._originalUuid = mbThreadModelImpl._uuid;
1213    
1214                    mbThreadModelImpl._originalGroupId = mbThreadModelImpl._groupId;
1215    
1216                    mbThreadModelImpl._setOriginalGroupId = false;
1217    
1218                    mbThreadModelImpl._originalCompanyId = mbThreadModelImpl._companyId;
1219    
1220                    mbThreadModelImpl._setOriginalCompanyId = false;
1221    
1222                    mbThreadModelImpl._setModifiedDate = false;
1223    
1224                    mbThreadModelImpl._originalCategoryId = mbThreadModelImpl._categoryId;
1225    
1226                    mbThreadModelImpl._setOriginalCategoryId = false;
1227    
1228                    mbThreadModelImpl._originalRootMessageId = mbThreadModelImpl._rootMessageId;
1229    
1230                    mbThreadModelImpl._setOriginalRootMessageId = false;
1231    
1232                    mbThreadModelImpl._originalLastPostDate = mbThreadModelImpl._lastPostDate;
1233    
1234                    mbThreadModelImpl._originalPriority = mbThreadModelImpl._priority;
1235    
1236                    mbThreadModelImpl._setOriginalPriority = false;
1237    
1238                    mbThreadModelImpl._originalStatus = mbThreadModelImpl._status;
1239    
1240                    mbThreadModelImpl._setOriginalStatus = false;
1241    
1242                    mbThreadModelImpl._columnBitmask = 0;
1243            }
1244    
1245            @Override
1246            public CacheModel<MBThread> toCacheModel() {
1247                    MBThreadCacheModel mbThreadCacheModel = new MBThreadCacheModel();
1248    
1249                    mbThreadCacheModel.uuid = getUuid();
1250    
1251                    String uuid = mbThreadCacheModel.uuid;
1252    
1253                    if ((uuid != null) && (uuid.length() == 0)) {
1254                            mbThreadCacheModel.uuid = null;
1255                    }
1256    
1257                    mbThreadCacheModel.threadId = getThreadId();
1258    
1259                    mbThreadCacheModel.groupId = getGroupId();
1260    
1261                    mbThreadCacheModel.companyId = getCompanyId();
1262    
1263                    mbThreadCacheModel.userId = getUserId();
1264    
1265                    mbThreadCacheModel.userName = getUserName();
1266    
1267                    String userName = mbThreadCacheModel.userName;
1268    
1269                    if ((userName != null) && (userName.length() == 0)) {
1270                            mbThreadCacheModel.userName = null;
1271                    }
1272    
1273                    Date createDate = getCreateDate();
1274    
1275                    if (createDate != null) {
1276                            mbThreadCacheModel.createDate = createDate.getTime();
1277                    }
1278                    else {
1279                            mbThreadCacheModel.createDate = Long.MIN_VALUE;
1280                    }
1281    
1282                    Date modifiedDate = getModifiedDate();
1283    
1284                    if (modifiedDate != null) {
1285                            mbThreadCacheModel.modifiedDate = modifiedDate.getTime();
1286                    }
1287                    else {
1288                            mbThreadCacheModel.modifiedDate = Long.MIN_VALUE;
1289                    }
1290    
1291                    mbThreadCacheModel.categoryId = getCategoryId();
1292    
1293                    mbThreadCacheModel.rootMessageId = getRootMessageId();
1294    
1295                    mbThreadCacheModel.rootMessageUserId = getRootMessageUserId();
1296    
1297                    mbThreadCacheModel.messageCount = getMessageCount();
1298    
1299                    mbThreadCacheModel.viewCount = getViewCount();
1300    
1301                    mbThreadCacheModel.lastPostByUserId = getLastPostByUserId();
1302    
1303                    Date lastPostDate = getLastPostDate();
1304    
1305                    if (lastPostDate != null) {
1306                            mbThreadCacheModel.lastPostDate = lastPostDate.getTime();
1307                    }
1308                    else {
1309                            mbThreadCacheModel.lastPostDate = Long.MIN_VALUE;
1310                    }
1311    
1312                    mbThreadCacheModel.priority = getPriority();
1313    
1314                    mbThreadCacheModel.question = getQuestion();
1315    
1316                    Date lastPublishDate = getLastPublishDate();
1317    
1318                    if (lastPublishDate != null) {
1319                            mbThreadCacheModel.lastPublishDate = lastPublishDate.getTime();
1320                    }
1321                    else {
1322                            mbThreadCacheModel.lastPublishDate = Long.MIN_VALUE;
1323                    }
1324    
1325                    mbThreadCacheModel.status = getStatus();
1326    
1327                    mbThreadCacheModel.statusByUserId = getStatusByUserId();
1328    
1329                    mbThreadCacheModel.statusByUserName = getStatusByUserName();
1330    
1331                    String statusByUserName = mbThreadCacheModel.statusByUserName;
1332    
1333                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1334                            mbThreadCacheModel.statusByUserName = null;
1335                    }
1336    
1337                    Date statusDate = getStatusDate();
1338    
1339                    if (statusDate != null) {
1340                            mbThreadCacheModel.statusDate = statusDate.getTime();
1341                    }
1342                    else {
1343                            mbThreadCacheModel.statusDate = Long.MIN_VALUE;
1344                    }
1345    
1346                    return mbThreadCacheModel;
1347            }
1348    
1349            @Override
1350            public String toString() {
1351                    StringBundler sb = new StringBundler(45);
1352    
1353                    sb.append("{uuid=");
1354                    sb.append(getUuid());
1355                    sb.append(", threadId=");
1356                    sb.append(getThreadId());
1357                    sb.append(", groupId=");
1358                    sb.append(getGroupId());
1359                    sb.append(", companyId=");
1360                    sb.append(getCompanyId());
1361                    sb.append(", userId=");
1362                    sb.append(getUserId());
1363                    sb.append(", userName=");
1364                    sb.append(getUserName());
1365                    sb.append(", createDate=");
1366                    sb.append(getCreateDate());
1367                    sb.append(", modifiedDate=");
1368                    sb.append(getModifiedDate());
1369                    sb.append(", categoryId=");
1370                    sb.append(getCategoryId());
1371                    sb.append(", rootMessageId=");
1372                    sb.append(getRootMessageId());
1373                    sb.append(", rootMessageUserId=");
1374                    sb.append(getRootMessageUserId());
1375                    sb.append(", messageCount=");
1376                    sb.append(getMessageCount());
1377                    sb.append(", viewCount=");
1378                    sb.append(getViewCount());
1379                    sb.append(", lastPostByUserId=");
1380                    sb.append(getLastPostByUserId());
1381                    sb.append(", lastPostDate=");
1382                    sb.append(getLastPostDate());
1383                    sb.append(", priority=");
1384                    sb.append(getPriority());
1385                    sb.append(", question=");
1386                    sb.append(getQuestion());
1387                    sb.append(", lastPublishDate=");
1388                    sb.append(getLastPublishDate());
1389                    sb.append(", status=");
1390                    sb.append(getStatus());
1391                    sb.append(", statusByUserId=");
1392                    sb.append(getStatusByUserId());
1393                    sb.append(", statusByUserName=");
1394                    sb.append(getStatusByUserName());
1395                    sb.append(", statusDate=");
1396                    sb.append(getStatusDate());
1397                    sb.append("}");
1398    
1399                    return sb.toString();
1400            }
1401    
1402            @Override
1403            public String toXmlString() {
1404                    StringBundler sb = new StringBundler(70);
1405    
1406                    sb.append("<model><model-name>");
1407                    sb.append("com.liferay.portlet.messageboards.model.MBThread");
1408                    sb.append("</model-name>");
1409    
1410                    sb.append(
1411                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1412                    sb.append(getUuid());
1413                    sb.append("]]></column-value></column>");
1414                    sb.append(
1415                            "<column><column-name>threadId</column-name><column-value><![CDATA[");
1416                    sb.append(getThreadId());
1417                    sb.append("]]></column-value></column>");
1418                    sb.append(
1419                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1420                    sb.append(getGroupId());
1421                    sb.append("]]></column-value></column>");
1422                    sb.append(
1423                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1424                    sb.append(getCompanyId());
1425                    sb.append("]]></column-value></column>");
1426                    sb.append(
1427                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1428                    sb.append(getUserId());
1429                    sb.append("]]></column-value></column>");
1430                    sb.append(
1431                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1432                    sb.append(getUserName());
1433                    sb.append("]]></column-value></column>");
1434                    sb.append(
1435                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1436                    sb.append(getCreateDate());
1437                    sb.append("]]></column-value></column>");
1438                    sb.append(
1439                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1440                    sb.append(getModifiedDate());
1441                    sb.append("]]></column-value></column>");
1442                    sb.append(
1443                            "<column><column-name>categoryId</column-name><column-value><![CDATA[");
1444                    sb.append(getCategoryId());
1445                    sb.append("]]></column-value></column>");
1446                    sb.append(
1447                            "<column><column-name>rootMessageId</column-name><column-value><![CDATA[");
1448                    sb.append(getRootMessageId());
1449                    sb.append("]]></column-value></column>");
1450                    sb.append(
1451                            "<column><column-name>rootMessageUserId</column-name><column-value><![CDATA[");
1452                    sb.append(getRootMessageUserId());
1453                    sb.append("]]></column-value></column>");
1454                    sb.append(
1455                            "<column><column-name>messageCount</column-name><column-value><![CDATA[");
1456                    sb.append(getMessageCount());
1457                    sb.append("]]></column-value></column>");
1458                    sb.append(
1459                            "<column><column-name>viewCount</column-name><column-value><![CDATA[");
1460                    sb.append(getViewCount());
1461                    sb.append("]]></column-value></column>");
1462                    sb.append(
1463                            "<column><column-name>lastPostByUserId</column-name><column-value><![CDATA[");
1464                    sb.append(getLastPostByUserId());
1465                    sb.append("]]></column-value></column>");
1466                    sb.append(
1467                            "<column><column-name>lastPostDate</column-name><column-value><![CDATA[");
1468                    sb.append(getLastPostDate());
1469                    sb.append("]]></column-value></column>");
1470                    sb.append(
1471                            "<column><column-name>priority</column-name><column-value><![CDATA[");
1472                    sb.append(getPriority());
1473                    sb.append("]]></column-value></column>");
1474                    sb.append(
1475                            "<column><column-name>question</column-name><column-value><![CDATA[");
1476                    sb.append(getQuestion());
1477                    sb.append("]]></column-value></column>");
1478                    sb.append(
1479                            "<column><column-name>lastPublishDate</column-name><column-value><![CDATA[");
1480                    sb.append(getLastPublishDate());
1481                    sb.append("]]></column-value></column>");
1482                    sb.append(
1483                            "<column><column-name>status</column-name><column-value><![CDATA[");
1484                    sb.append(getStatus());
1485                    sb.append("]]></column-value></column>");
1486                    sb.append(
1487                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1488                    sb.append(getStatusByUserId());
1489                    sb.append("]]></column-value></column>");
1490                    sb.append(
1491                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1492                    sb.append(getStatusByUserName());
1493                    sb.append("]]></column-value></column>");
1494                    sb.append(
1495                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1496                    sb.append(getStatusDate());
1497                    sb.append("]]></column-value></column>");
1498    
1499                    sb.append("</model>");
1500    
1501                    return sb.toString();
1502            }
1503    
1504            private static final ClassLoader _classLoader = MBThread.class.getClassLoader();
1505            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1506                            MBThread.class
1507                    };
1508            private String _uuid;
1509            private String _originalUuid;
1510            private long _threadId;
1511            private long _groupId;
1512            private long _originalGroupId;
1513            private boolean _setOriginalGroupId;
1514            private long _companyId;
1515            private long _originalCompanyId;
1516            private boolean _setOriginalCompanyId;
1517            private long _userId;
1518            private String _userName;
1519            private Date _createDate;
1520            private Date _modifiedDate;
1521            private boolean _setModifiedDate;
1522            private long _categoryId;
1523            private long _originalCategoryId;
1524            private boolean _setOriginalCategoryId;
1525            private long _rootMessageId;
1526            private long _originalRootMessageId;
1527            private boolean _setOriginalRootMessageId;
1528            private long _rootMessageUserId;
1529            private int _messageCount;
1530            private int _viewCount;
1531            private long _lastPostByUserId;
1532            private Date _lastPostDate;
1533            private Date _originalLastPostDate;
1534            private double _priority;
1535            private double _originalPriority;
1536            private boolean _setOriginalPriority;
1537            private boolean _question;
1538            private Date _lastPublishDate;
1539            private int _status;
1540            private int _originalStatus;
1541            private boolean _setOriginalStatus;
1542            private long _statusByUserId;
1543            private String _statusByUserName;
1544            private Date _statusDate;
1545            private long _columnBitmask;
1546            private MBThread _escapedModel;
1547    }