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.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            /**
1002             * @deprecated As of 6.1.0, replaced by {@link #isApproved}
1003             */
1004            @Deprecated
1005            @Override
1006            public boolean getApproved() {
1007                    return isApproved();
1008            }
1009    
1010            @Override
1011            public boolean isApproved() {
1012                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
1013                            return true;
1014                    }
1015                    else {
1016                            return false;
1017                    }
1018            }
1019    
1020            @Override
1021            public boolean isDenied() {
1022                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
1023                            return true;
1024                    }
1025                    else {
1026                            return false;
1027                    }
1028            }
1029    
1030            @Override
1031            public boolean isDraft() {
1032                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
1033                            return true;
1034                    }
1035                    else {
1036                            return false;
1037                    }
1038            }
1039    
1040            @Override
1041            public boolean isExpired() {
1042                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
1043                            return true;
1044                    }
1045                    else {
1046                            return false;
1047                    }
1048            }
1049    
1050            @Override
1051            public boolean isInactive() {
1052                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
1053                            return true;
1054                    }
1055                    else {
1056                            return false;
1057                    }
1058            }
1059    
1060            @Override
1061            public boolean isIncomplete() {
1062                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
1063                            return true;
1064                    }
1065                    else {
1066                            return false;
1067                    }
1068            }
1069    
1070            @Override
1071            public boolean isPending() {
1072                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
1073                            return true;
1074                    }
1075                    else {
1076                            return false;
1077                    }
1078            }
1079    
1080            @Override
1081            public boolean isScheduled() {
1082                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
1083                            return true;
1084                    }
1085                    else {
1086                            return false;
1087                    }
1088            }
1089    
1090            public long getColumnBitmask() {
1091                    return _columnBitmask;
1092            }
1093    
1094            @Override
1095            public ExpandoBridge getExpandoBridge() {
1096                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
1097                            MBThread.class.getName(), getPrimaryKey());
1098            }
1099    
1100            @Override
1101            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
1102                    ExpandoBridge expandoBridge = getExpandoBridge();
1103    
1104                    expandoBridge.setAttributes(serviceContext);
1105            }
1106    
1107            @Override
1108            public MBThread toEscapedModel() {
1109                    if (_escapedModel == null) {
1110                            _escapedModel = (MBThread)ProxyUtil.newProxyInstance(_classLoader,
1111                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
1112                    }
1113    
1114                    return _escapedModel;
1115            }
1116    
1117            @Override
1118            public Object clone() {
1119                    MBThreadImpl mbThreadImpl = new MBThreadImpl();
1120    
1121                    mbThreadImpl.setUuid(getUuid());
1122                    mbThreadImpl.setThreadId(getThreadId());
1123                    mbThreadImpl.setGroupId(getGroupId());
1124                    mbThreadImpl.setCompanyId(getCompanyId());
1125                    mbThreadImpl.setUserId(getUserId());
1126                    mbThreadImpl.setUserName(getUserName());
1127                    mbThreadImpl.setCreateDate(getCreateDate());
1128                    mbThreadImpl.setModifiedDate(getModifiedDate());
1129                    mbThreadImpl.setCategoryId(getCategoryId());
1130                    mbThreadImpl.setRootMessageId(getRootMessageId());
1131                    mbThreadImpl.setRootMessageUserId(getRootMessageUserId());
1132                    mbThreadImpl.setMessageCount(getMessageCount());
1133                    mbThreadImpl.setViewCount(getViewCount());
1134                    mbThreadImpl.setLastPostByUserId(getLastPostByUserId());
1135                    mbThreadImpl.setLastPostDate(getLastPostDate());
1136                    mbThreadImpl.setPriority(getPriority());
1137                    mbThreadImpl.setQuestion(getQuestion());
1138                    mbThreadImpl.setLastPublishDate(getLastPublishDate());
1139                    mbThreadImpl.setStatus(getStatus());
1140                    mbThreadImpl.setStatusByUserId(getStatusByUserId());
1141                    mbThreadImpl.setStatusByUserName(getStatusByUserName());
1142                    mbThreadImpl.setStatusDate(getStatusDate());
1143    
1144                    mbThreadImpl.resetOriginalValues();
1145    
1146                    return mbThreadImpl;
1147            }
1148    
1149            @Override
1150            public int compareTo(MBThread mbThread) {
1151                    int value = 0;
1152    
1153                    if (getPriority() < mbThread.getPriority()) {
1154                            value = -1;
1155                    }
1156                    else if (getPriority() > mbThread.getPriority()) {
1157                            value = 1;
1158                    }
1159                    else {
1160                            value = 0;
1161                    }
1162    
1163                    value = value * -1;
1164    
1165                    if (value != 0) {
1166                            return value;
1167                    }
1168    
1169                    value = DateUtil.compareTo(getLastPostDate(), mbThread.getLastPostDate());
1170    
1171                    value = value * -1;
1172    
1173                    if (value != 0) {
1174                            return value;
1175                    }
1176    
1177                    return 0;
1178            }
1179    
1180            @Override
1181            public boolean equals(Object obj) {
1182                    if (this == obj) {
1183                            return true;
1184                    }
1185    
1186                    if (!(obj instanceof MBThread)) {
1187                            return false;
1188                    }
1189    
1190                    MBThread mbThread = (MBThread)obj;
1191    
1192                    long primaryKey = mbThread.getPrimaryKey();
1193    
1194                    if (getPrimaryKey() == primaryKey) {
1195                            return true;
1196                    }
1197                    else {
1198                            return false;
1199                    }
1200            }
1201    
1202            @Override
1203            public int hashCode() {
1204                    return (int)getPrimaryKey();
1205            }
1206    
1207            @Override
1208            public boolean isEntityCacheEnabled() {
1209                    return ENTITY_CACHE_ENABLED;
1210            }
1211    
1212            @Override
1213            public boolean isFinderCacheEnabled() {
1214                    return FINDER_CACHE_ENABLED;
1215            }
1216    
1217            @Override
1218            public void resetOriginalValues() {
1219                    MBThreadModelImpl mbThreadModelImpl = this;
1220    
1221                    mbThreadModelImpl._originalUuid = mbThreadModelImpl._uuid;
1222    
1223                    mbThreadModelImpl._originalGroupId = mbThreadModelImpl._groupId;
1224    
1225                    mbThreadModelImpl._setOriginalGroupId = false;
1226    
1227                    mbThreadModelImpl._originalCompanyId = mbThreadModelImpl._companyId;
1228    
1229                    mbThreadModelImpl._setOriginalCompanyId = false;
1230    
1231                    mbThreadModelImpl._setModifiedDate = false;
1232    
1233                    mbThreadModelImpl._originalCategoryId = mbThreadModelImpl._categoryId;
1234    
1235                    mbThreadModelImpl._setOriginalCategoryId = false;
1236    
1237                    mbThreadModelImpl._originalRootMessageId = mbThreadModelImpl._rootMessageId;
1238    
1239                    mbThreadModelImpl._setOriginalRootMessageId = false;
1240    
1241                    mbThreadModelImpl._originalLastPostDate = mbThreadModelImpl._lastPostDate;
1242    
1243                    mbThreadModelImpl._originalPriority = mbThreadModelImpl._priority;
1244    
1245                    mbThreadModelImpl._setOriginalPriority = false;
1246    
1247                    mbThreadModelImpl._originalStatus = mbThreadModelImpl._status;
1248    
1249                    mbThreadModelImpl._setOriginalStatus = false;
1250    
1251                    mbThreadModelImpl._columnBitmask = 0;
1252            }
1253    
1254            @Override
1255            public CacheModel<MBThread> toCacheModel() {
1256                    MBThreadCacheModel mbThreadCacheModel = new MBThreadCacheModel();
1257    
1258                    mbThreadCacheModel.uuid = getUuid();
1259    
1260                    String uuid = mbThreadCacheModel.uuid;
1261    
1262                    if ((uuid != null) && (uuid.length() == 0)) {
1263                            mbThreadCacheModel.uuid = null;
1264                    }
1265    
1266                    mbThreadCacheModel.threadId = getThreadId();
1267    
1268                    mbThreadCacheModel.groupId = getGroupId();
1269    
1270                    mbThreadCacheModel.companyId = getCompanyId();
1271    
1272                    mbThreadCacheModel.userId = getUserId();
1273    
1274                    mbThreadCacheModel.userName = getUserName();
1275    
1276                    String userName = mbThreadCacheModel.userName;
1277    
1278                    if ((userName != null) && (userName.length() == 0)) {
1279                            mbThreadCacheModel.userName = null;
1280                    }
1281    
1282                    Date createDate = getCreateDate();
1283    
1284                    if (createDate != null) {
1285                            mbThreadCacheModel.createDate = createDate.getTime();
1286                    }
1287                    else {
1288                            mbThreadCacheModel.createDate = Long.MIN_VALUE;
1289                    }
1290    
1291                    Date modifiedDate = getModifiedDate();
1292    
1293                    if (modifiedDate != null) {
1294                            mbThreadCacheModel.modifiedDate = modifiedDate.getTime();
1295                    }
1296                    else {
1297                            mbThreadCacheModel.modifiedDate = Long.MIN_VALUE;
1298                    }
1299    
1300                    mbThreadCacheModel.categoryId = getCategoryId();
1301    
1302                    mbThreadCacheModel.rootMessageId = getRootMessageId();
1303    
1304                    mbThreadCacheModel.rootMessageUserId = getRootMessageUserId();
1305    
1306                    mbThreadCacheModel.messageCount = getMessageCount();
1307    
1308                    mbThreadCacheModel.viewCount = getViewCount();
1309    
1310                    mbThreadCacheModel.lastPostByUserId = getLastPostByUserId();
1311    
1312                    Date lastPostDate = getLastPostDate();
1313    
1314                    if (lastPostDate != null) {
1315                            mbThreadCacheModel.lastPostDate = lastPostDate.getTime();
1316                    }
1317                    else {
1318                            mbThreadCacheModel.lastPostDate = Long.MIN_VALUE;
1319                    }
1320    
1321                    mbThreadCacheModel.priority = getPriority();
1322    
1323                    mbThreadCacheModel.question = getQuestion();
1324    
1325                    Date lastPublishDate = getLastPublishDate();
1326    
1327                    if (lastPublishDate != null) {
1328                            mbThreadCacheModel.lastPublishDate = lastPublishDate.getTime();
1329                    }
1330                    else {
1331                            mbThreadCacheModel.lastPublishDate = Long.MIN_VALUE;
1332                    }
1333    
1334                    mbThreadCacheModel.status = getStatus();
1335    
1336                    mbThreadCacheModel.statusByUserId = getStatusByUserId();
1337    
1338                    mbThreadCacheModel.statusByUserName = getStatusByUserName();
1339    
1340                    String statusByUserName = mbThreadCacheModel.statusByUserName;
1341    
1342                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
1343                            mbThreadCacheModel.statusByUserName = null;
1344                    }
1345    
1346                    Date statusDate = getStatusDate();
1347    
1348                    if (statusDate != null) {
1349                            mbThreadCacheModel.statusDate = statusDate.getTime();
1350                    }
1351                    else {
1352                            mbThreadCacheModel.statusDate = Long.MIN_VALUE;
1353                    }
1354    
1355                    return mbThreadCacheModel;
1356            }
1357    
1358            @Override
1359            public String toString() {
1360                    StringBundler sb = new StringBundler(45);
1361    
1362                    sb.append("{uuid=");
1363                    sb.append(getUuid());
1364                    sb.append(", threadId=");
1365                    sb.append(getThreadId());
1366                    sb.append(", groupId=");
1367                    sb.append(getGroupId());
1368                    sb.append(", companyId=");
1369                    sb.append(getCompanyId());
1370                    sb.append(", userId=");
1371                    sb.append(getUserId());
1372                    sb.append(", userName=");
1373                    sb.append(getUserName());
1374                    sb.append(", createDate=");
1375                    sb.append(getCreateDate());
1376                    sb.append(", modifiedDate=");
1377                    sb.append(getModifiedDate());
1378                    sb.append(", categoryId=");
1379                    sb.append(getCategoryId());
1380                    sb.append(", rootMessageId=");
1381                    sb.append(getRootMessageId());
1382                    sb.append(", rootMessageUserId=");
1383                    sb.append(getRootMessageUserId());
1384                    sb.append(", messageCount=");
1385                    sb.append(getMessageCount());
1386                    sb.append(", viewCount=");
1387                    sb.append(getViewCount());
1388                    sb.append(", lastPostByUserId=");
1389                    sb.append(getLastPostByUserId());
1390                    sb.append(", lastPostDate=");
1391                    sb.append(getLastPostDate());
1392                    sb.append(", priority=");
1393                    sb.append(getPriority());
1394                    sb.append(", question=");
1395                    sb.append(getQuestion());
1396                    sb.append(", lastPublishDate=");
1397                    sb.append(getLastPublishDate());
1398                    sb.append(", status=");
1399                    sb.append(getStatus());
1400                    sb.append(", statusByUserId=");
1401                    sb.append(getStatusByUserId());
1402                    sb.append(", statusByUserName=");
1403                    sb.append(getStatusByUserName());
1404                    sb.append(", statusDate=");
1405                    sb.append(getStatusDate());
1406                    sb.append("}");
1407    
1408                    return sb.toString();
1409            }
1410    
1411            @Override
1412            public String toXmlString() {
1413                    StringBundler sb = new StringBundler(70);
1414    
1415                    sb.append("<model><model-name>");
1416                    sb.append("com.liferay.portlet.messageboards.model.MBThread");
1417                    sb.append("</model-name>");
1418    
1419                    sb.append(
1420                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1421                    sb.append(getUuid());
1422                    sb.append("]]></column-value></column>");
1423                    sb.append(
1424                            "<column><column-name>threadId</column-name><column-value><![CDATA[");
1425                    sb.append(getThreadId());
1426                    sb.append("]]></column-value></column>");
1427                    sb.append(
1428                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1429                    sb.append(getGroupId());
1430                    sb.append("]]></column-value></column>");
1431                    sb.append(
1432                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1433                    sb.append(getCompanyId());
1434                    sb.append("]]></column-value></column>");
1435                    sb.append(
1436                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1437                    sb.append(getUserId());
1438                    sb.append("]]></column-value></column>");
1439                    sb.append(
1440                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1441                    sb.append(getUserName());
1442                    sb.append("]]></column-value></column>");
1443                    sb.append(
1444                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1445                    sb.append(getCreateDate());
1446                    sb.append("]]></column-value></column>");
1447                    sb.append(
1448                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1449                    sb.append(getModifiedDate());
1450                    sb.append("]]></column-value></column>");
1451                    sb.append(
1452                            "<column><column-name>categoryId</column-name><column-value><![CDATA[");
1453                    sb.append(getCategoryId());
1454                    sb.append("]]></column-value></column>");
1455                    sb.append(
1456                            "<column><column-name>rootMessageId</column-name><column-value><![CDATA[");
1457                    sb.append(getRootMessageId());
1458                    sb.append("]]></column-value></column>");
1459                    sb.append(
1460                            "<column><column-name>rootMessageUserId</column-name><column-value><![CDATA[");
1461                    sb.append(getRootMessageUserId());
1462                    sb.append("]]></column-value></column>");
1463                    sb.append(
1464                            "<column><column-name>messageCount</column-name><column-value><![CDATA[");
1465                    sb.append(getMessageCount());
1466                    sb.append("]]></column-value></column>");
1467                    sb.append(
1468                            "<column><column-name>viewCount</column-name><column-value><![CDATA[");
1469                    sb.append(getViewCount());
1470                    sb.append("]]></column-value></column>");
1471                    sb.append(
1472                            "<column><column-name>lastPostByUserId</column-name><column-value><![CDATA[");
1473                    sb.append(getLastPostByUserId());
1474                    sb.append("]]></column-value></column>");
1475                    sb.append(
1476                            "<column><column-name>lastPostDate</column-name><column-value><![CDATA[");
1477                    sb.append(getLastPostDate());
1478                    sb.append("]]></column-value></column>");
1479                    sb.append(
1480                            "<column><column-name>priority</column-name><column-value><![CDATA[");
1481                    sb.append(getPriority());
1482                    sb.append("]]></column-value></column>");
1483                    sb.append(
1484                            "<column><column-name>question</column-name><column-value><![CDATA[");
1485                    sb.append(getQuestion());
1486                    sb.append("]]></column-value></column>");
1487                    sb.append(
1488                            "<column><column-name>lastPublishDate</column-name><column-value><![CDATA[");
1489                    sb.append(getLastPublishDate());
1490                    sb.append("]]></column-value></column>");
1491                    sb.append(
1492                            "<column><column-name>status</column-name><column-value><![CDATA[");
1493                    sb.append(getStatus());
1494                    sb.append("]]></column-value></column>");
1495                    sb.append(
1496                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1497                    sb.append(getStatusByUserId());
1498                    sb.append("]]></column-value></column>");
1499                    sb.append(
1500                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1501                    sb.append(getStatusByUserName());
1502                    sb.append("]]></column-value></column>");
1503                    sb.append(
1504                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1505                    sb.append(getStatusDate());
1506                    sb.append("]]></column-value></column>");
1507    
1508                    sb.append("</model>");
1509    
1510                    return sb.toString();
1511            }
1512    
1513            private static final ClassLoader _classLoader = MBThread.class.getClassLoader();
1514            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1515                            MBThread.class
1516                    };
1517            private String _uuid;
1518            private String _originalUuid;
1519            private long _threadId;
1520            private long _groupId;
1521            private long _originalGroupId;
1522            private boolean _setOriginalGroupId;
1523            private long _companyId;
1524            private long _originalCompanyId;
1525            private boolean _setOriginalCompanyId;
1526            private long _userId;
1527            private String _userName;
1528            private Date _createDate;
1529            private Date _modifiedDate;
1530            private boolean _setModifiedDate;
1531            private long _categoryId;
1532            private long _originalCategoryId;
1533            private boolean _setOriginalCategoryId;
1534            private long _rootMessageId;
1535            private long _originalRootMessageId;
1536            private boolean _setOriginalRootMessageId;
1537            private long _rootMessageUserId;
1538            private int _messageCount;
1539            private int _viewCount;
1540            private long _lastPostByUserId;
1541            private Date _lastPostDate;
1542            private Date _originalLastPostDate;
1543            private double _priority;
1544            private double _originalPriority;
1545            private boolean _setOriginalPriority;
1546            private boolean _question;
1547            private Date _lastPublishDate;
1548            private int _status;
1549            private int _originalStatus;
1550            private boolean _setOriginalStatus;
1551            private long _statusByUserId;
1552            private String _statusByUserName;
1553            private Date _statusDate;
1554            private long _columnBitmask;
1555            private MBThread _escapedModel;
1556    }