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.kernel.bean.AutoEscapeBeanHandler;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.util.GetterUtil;
022    import com.liferay.portal.kernel.util.ProxyUtil;
023    import com.liferay.portal.kernel.util.StringBundler;
024    import com.liferay.portal.kernel.util.StringPool;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.User;
027    import com.liferay.portal.model.impl.BaseModelImpl;
028    import com.liferay.portal.service.ServiceContext;
029    import com.liferay.portal.service.UserLocalServiceUtil;
030    import com.liferay.portal.util.PortalUtil;
031    
032    import com.liferay.portlet.expando.model.ExpandoBridge;
033    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
034    import com.liferay.portlet.exportimport.lar.StagedModelType;
035    import com.liferay.portlet.messageboards.model.MBMailingList;
036    import com.liferay.portlet.messageboards.model.MBMailingListModel;
037    
038    import java.io.Serializable;
039    
040    import java.sql.Types;
041    
042    import java.util.Date;
043    import java.util.HashMap;
044    import java.util.Map;
045    
046    /**
047     * The base model implementation for the MBMailingList service. Represents a row in the "MBMailingList" database table, with each column mapped to a property of this class.
048     *
049     * <p>
050     * This implementation and its corresponding interface {@link MBMailingListModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link MBMailingListImpl}.
051     * </p>
052     *
053     * @author Brian Wing Shun Chan
054     * @see MBMailingListImpl
055     * @see MBMailingList
056     * @see MBMailingListModel
057     * @generated
058     */
059    @ProviderType
060    public class MBMailingListModelImpl extends BaseModelImpl<MBMailingList>
061            implements MBMailingListModel {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. All methods that expect a message boards mailing list model instance should use the {@link MBMailingList} interface instead.
066             */
067            public static final String TABLE_NAME = "MBMailingList";
068            public static final Object[][] TABLE_COLUMNS = {
069                            { "uuid_", Types.VARCHAR },
070                            { "mailingListId", Types.BIGINT },
071                            { "groupId", Types.BIGINT },
072                            { "companyId", Types.BIGINT },
073                            { "userId", Types.BIGINT },
074                            { "userName", Types.VARCHAR },
075                            { "createDate", Types.TIMESTAMP },
076                            { "modifiedDate", Types.TIMESTAMP },
077                            { "categoryId", Types.BIGINT },
078                            { "emailAddress", Types.VARCHAR },
079                            { "inProtocol", Types.VARCHAR },
080                            { "inServerName", Types.VARCHAR },
081                            { "inServerPort", Types.INTEGER },
082                            { "inUseSSL", Types.BOOLEAN },
083                            { "inUserName", Types.VARCHAR },
084                            { "inPassword", Types.VARCHAR },
085                            { "inReadInterval", Types.INTEGER },
086                            { "outEmailAddress", Types.VARCHAR },
087                            { "outCustom", Types.BOOLEAN },
088                            { "outServerName", Types.VARCHAR },
089                            { "outServerPort", Types.INTEGER },
090                            { "outUseSSL", Types.BOOLEAN },
091                            { "outUserName", Types.VARCHAR },
092                            { "outPassword", Types.VARCHAR },
093                            { "allowAnonymous", Types.BOOLEAN },
094                            { "active_", Types.BOOLEAN }
095                    };
096            public static final String TABLE_SQL_CREATE = "create table MBMailingList (uuid_ VARCHAR(75) null,mailingListId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,categoryId LONG,emailAddress VARCHAR(75) null,inProtocol VARCHAR(75) null,inServerName VARCHAR(75) null,inServerPort INTEGER,inUseSSL BOOLEAN,inUserName VARCHAR(75) null,inPassword VARCHAR(75) null,inReadInterval INTEGER,outEmailAddress VARCHAR(75) null,outCustom BOOLEAN,outServerName VARCHAR(75) null,outServerPort INTEGER,outUseSSL BOOLEAN,outUserName VARCHAR(75) null,outPassword VARCHAR(75) null,allowAnonymous BOOLEAN,active_ BOOLEAN)";
097            public static final String TABLE_SQL_DROP = "drop table MBMailingList";
098            public static final String ORDER_BY_JPQL = " ORDER BY mbMailingList.mailingListId ASC";
099            public static final String ORDER_BY_SQL = " ORDER BY MBMailingList.mailingListId ASC";
100            public static final String DATA_SOURCE = "liferayDataSource";
101            public static final String SESSION_FACTORY = "liferaySessionFactory";
102            public static final String TX_MANAGER = "liferayTransactionManager";
103            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
104                                    "value.object.entity.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
105                            true);
106            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
107                                    "value.object.finder.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
108                            true);
109            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
110                                    "value.object.column.bitmask.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
111                            true);
112            public static final long ACTIVE_COLUMN_BITMASK = 1L;
113            public static final long CATEGORYID_COLUMN_BITMASK = 2L;
114            public static final long COMPANYID_COLUMN_BITMASK = 4L;
115            public static final long GROUPID_COLUMN_BITMASK = 8L;
116            public static final long UUID_COLUMN_BITMASK = 16L;
117            public static final long MAILINGLISTID_COLUMN_BITMASK = 32L;
118            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
119                                    "lock.expiration.time.com.liferay.portlet.messageboards.model.MBMailingList"));
120    
121            public MBMailingListModelImpl() {
122            }
123    
124            @Override
125            public long getPrimaryKey() {
126                    return _mailingListId;
127            }
128    
129            @Override
130            public void setPrimaryKey(long primaryKey) {
131                    setMailingListId(primaryKey);
132            }
133    
134            @Override
135            public Serializable getPrimaryKeyObj() {
136                    return _mailingListId;
137            }
138    
139            @Override
140            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
141                    setPrimaryKey(((Long)primaryKeyObj).longValue());
142            }
143    
144            @Override
145            public Class<?> getModelClass() {
146                    return MBMailingList.class;
147            }
148    
149            @Override
150            public String getModelClassName() {
151                    return MBMailingList.class.getName();
152            }
153    
154            @Override
155            public Map<String, Object> getModelAttributes() {
156                    Map<String, Object> attributes = new HashMap<String, Object>();
157    
158                    attributes.put("uuid", getUuid());
159                    attributes.put("mailingListId", getMailingListId());
160                    attributes.put("groupId", getGroupId());
161                    attributes.put("companyId", getCompanyId());
162                    attributes.put("userId", getUserId());
163                    attributes.put("userName", getUserName());
164                    attributes.put("createDate", getCreateDate());
165                    attributes.put("modifiedDate", getModifiedDate());
166                    attributes.put("categoryId", getCategoryId());
167                    attributes.put("emailAddress", getEmailAddress());
168                    attributes.put("inProtocol", getInProtocol());
169                    attributes.put("inServerName", getInServerName());
170                    attributes.put("inServerPort", getInServerPort());
171                    attributes.put("inUseSSL", getInUseSSL());
172                    attributes.put("inUserName", getInUserName());
173                    attributes.put("inPassword", getInPassword());
174                    attributes.put("inReadInterval", getInReadInterval());
175                    attributes.put("outEmailAddress", getOutEmailAddress());
176                    attributes.put("outCustom", getOutCustom());
177                    attributes.put("outServerName", getOutServerName());
178                    attributes.put("outServerPort", getOutServerPort());
179                    attributes.put("outUseSSL", getOutUseSSL());
180                    attributes.put("outUserName", getOutUserName());
181                    attributes.put("outPassword", getOutPassword());
182                    attributes.put("allowAnonymous", getAllowAnonymous());
183                    attributes.put("active", getActive());
184    
185                    attributes.put("entityCacheEnabled", isEntityCacheEnabled());
186                    attributes.put("finderCacheEnabled", isFinderCacheEnabled());
187    
188                    return attributes;
189            }
190    
191            @Override
192            public void setModelAttributes(Map<String, Object> attributes) {
193                    String uuid = (String)attributes.get("uuid");
194    
195                    if (uuid != null) {
196                            setUuid(uuid);
197                    }
198    
199                    Long mailingListId = (Long)attributes.get("mailingListId");
200    
201                    if (mailingListId != null) {
202                            setMailingListId(mailingListId);
203                    }
204    
205                    Long groupId = (Long)attributes.get("groupId");
206    
207                    if (groupId != null) {
208                            setGroupId(groupId);
209                    }
210    
211                    Long companyId = (Long)attributes.get("companyId");
212    
213                    if (companyId != null) {
214                            setCompanyId(companyId);
215                    }
216    
217                    Long userId = (Long)attributes.get("userId");
218    
219                    if (userId != null) {
220                            setUserId(userId);
221                    }
222    
223                    String userName = (String)attributes.get("userName");
224    
225                    if (userName != null) {
226                            setUserName(userName);
227                    }
228    
229                    Date createDate = (Date)attributes.get("createDate");
230    
231                    if (createDate != null) {
232                            setCreateDate(createDate);
233                    }
234    
235                    Date modifiedDate = (Date)attributes.get("modifiedDate");
236    
237                    if (modifiedDate != null) {
238                            setModifiedDate(modifiedDate);
239                    }
240    
241                    Long categoryId = (Long)attributes.get("categoryId");
242    
243                    if (categoryId != null) {
244                            setCategoryId(categoryId);
245                    }
246    
247                    String emailAddress = (String)attributes.get("emailAddress");
248    
249                    if (emailAddress != null) {
250                            setEmailAddress(emailAddress);
251                    }
252    
253                    String inProtocol = (String)attributes.get("inProtocol");
254    
255                    if (inProtocol != null) {
256                            setInProtocol(inProtocol);
257                    }
258    
259                    String inServerName = (String)attributes.get("inServerName");
260    
261                    if (inServerName != null) {
262                            setInServerName(inServerName);
263                    }
264    
265                    Integer inServerPort = (Integer)attributes.get("inServerPort");
266    
267                    if (inServerPort != null) {
268                            setInServerPort(inServerPort);
269                    }
270    
271                    Boolean inUseSSL = (Boolean)attributes.get("inUseSSL");
272    
273                    if (inUseSSL != null) {
274                            setInUseSSL(inUseSSL);
275                    }
276    
277                    String inUserName = (String)attributes.get("inUserName");
278    
279                    if (inUserName != null) {
280                            setInUserName(inUserName);
281                    }
282    
283                    String inPassword = (String)attributes.get("inPassword");
284    
285                    if (inPassword != null) {
286                            setInPassword(inPassword);
287                    }
288    
289                    Integer inReadInterval = (Integer)attributes.get("inReadInterval");
290    
291                    if (inReadInterval != null) {
292                            setInReadInterval(inReadInterval);
293                    }
294    
295                    String outEmailAddress = (String)attributes.get("outEmailAddress");
296    
297                    if (outEmailAddress != null) {
298                            setOutEmailAddress(outEmailAddress);
299                    }
300    
301                    Boolean outCustom = (Boolean)attributes.get("outCustom");
302    
303                    if (outCustom != null) {
304                            setOutCustom(outCustom);
305                    }
306    
307                    String outServerName = (String)attributes.get("outServerName");
308    
309                    if (outServerName != null) {
310                            setOutServerName(outServerName);
311                    }
312    
313                    Integer outServerPort = (Integer)attributes.get("outServerPort");
314    
315                    if (outServerPort != null) {
316                            setOutServerPort(outServerPort);
317                    }
318    
319                    Boolean outUseSSL = (Boolean)attributes.get("outUseSSL");
320    
321                    if (outUseSSL != null) {
322                            setOutUseSSL(outUseSSL);
323                    }
324    
325                    String outUserName = (String)attributes.get("outUserName");
326    
327                    if (outUserName != null) {
328                            setOutUserName(outUserName);
329                    }
330    
331                    String outPassword = (String)attributes.get("outPassword");
332    
333                    if (outPassword != null) {
334                            setOutPassword(outPassword);
335                    }
336    
337                    Boolean allowAnonymous = (Boolean)attributes.get("allowAnonymous");
338    
339                    if (allowAnonymous != null) {
340                            setAllowAnonymous(allowAnonymous);
341                    }
342    
343                    Boolean active = (Boolean)attributes.get("active");
344    
345                    if (active != null) {
346                            setActive(active);
347                    }
348            }
349    
350            @Override
351            public String getUuid() {
352                    if (_uuid == null) {
353                            return StringPool.BLANK;
354                    }
355                    else {
356                            return _uuid;
357                    }
358            }
359    
360            @Override
361            public void setUuid(String uuid) {
362                    if (_originalUuid == null) {
363                            _originalUuid = _uuid;
364                    }
365    
366                    _uuid = uuid;
367            }
368    
369            public String getOriginalUuid() {
370                    return GetterUtil.getString(_originalUuid);
371            }
372    
373            @Override
374            public long getMailingListId() {
375                    return _mailingListId;
376            }
377    
378            @Override
379            public void setMailingListId(long mailingListId) {
380                    _mailingListId = mailingListId;
381            }
382    
383            @Override
384            public long getGroupId() {
385                    return _groupId;
386            }
387    
388            @Override
389            public void setGroupId(long groupId) {
390                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
391    
392                    if (!_setOriginalGroupId) {
393                            _setOriginalGroupId = true;
394    
395                            _originalGroupId = _groupId;
396                    }
397    
398                    _groupId = groupId;
399            }
400    
401            public long getOriginalGroupId() {
402                    return _originalGroupId;
403            }
404    
405            @Override
406            public long getCompanyId() {
407                    return _companyId;
408            }
409    
410            @Override
411            public void setCompanyId(long companyId) {
412                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
413    
414                    if (!_setOriginalCompanyId) {
415                            _setOriginalCompanyId = true;
416    
417                            _originalCompanyId = _companyId;
418                    }
419    
420                    _companyId = companyId;
421            }
422    
423            public long getOriginalCompanyId() {
424                    return _originalCompanyId;
425            }
426    
427            @Override
428            public long getUserId() {
429                    return _userId;
430            }
431    
432            @Override
433            public void setUserId(long userId) {
434                    _userId = userId;
435            }
436    
437            @Override
438            public String getUserUuid() {
439                    try {
440                            User user = UserLocalServiceUtil.getUserById(getUserId());
441    
442                            return user.getUuid();
443                    }
444                    catch (PortalException pe) {
445                            return StringPool.BLANK;
446                    }
447            }
448    
449            @Override
450            public void setUserUuid(String userUuid) {
451            }
452    
453            @Override
454            public String getUserName() {
455                    if (_userName == null) {
456                            return StringPool.BLANK;
457                    }
458                    else {
459                            return _userName;
460                    }
461            }
462    
463            @Override
464            public void setUserName(String userName) {
465                    _userName = userName;
466            }
467    
468            @Override
469            public Date getCreateDate() {
470                    return _createDate;
471            }
472    
473            @Override
474            public void setCreateDate(Date createDate) {
475                    _createDate = createDate;
476            }
477    
478            @Override
479            public Date getModifiedDate() {
480                    return _modifiedDate;
481            }
482    
483            public boolean hasSetModifiedDate() {
484                    return _setModifiedDate;
485            }
486    
487            @Override
488            public void setModifiedDate(Date modifiedDate) {
489                    _setModifiedDate = true;
490    
491                    _modifiedDate = modifiedDate;
492            }
493    
494            @Override
495            public long getCategoryId() {
496                    return _categoryId;
497            }
498    
499            @Override
500            public void setCategoryId(long categoryId) {
501                    _columnBitmask |= CATEGORYID_COLUMN_BITMASK;
502    
503                    if (!_setOriginalCategoryId) {
504                            _setOriginalCategoryId = true;
505    
506                            _originalCategoryId = _categoryId;
507                    }
508    
509                    _categoryId = categoryId;
510            }
511    
512            public long getOriginalCategoryId() {
513                    return _originalCategoryId;
514            }
515    
516            @Override
517            public String getEmailAddress() {
518                    if (_emailAddress == null) {
519                            return StringPool.BLANK;
520                    }
521                    else {
522                            return _emailAddress;
523                    }
524            }
525    
526            @Override
527            public void setEmailAddress(String emailAddress) {
528                    _emailAddress = emailAddress;
529            }
530    
531            @Override
532            public String getInProtocol() {
533                    if (_inProtocol == null) {
534                            return StringPool.BLANK;
535                    }
536                    else {
537                            return _inProtocol;
538                    }
539            }
540    
541            @Override
542            public void setInProtocol(String inProtocol) {
543                    _inProtocol = inProtocol;
544            }
545    
546            @Override
547            public String getInServerName() {
548                    if (_inServerName == null) {
549                            return StringPool.BLANK;
550                    }
551                    else {
552                            return _inServerName;
553                    }
554            }
555    
556            @Override
557            public void setInServerName(String inServerName) {
558                    _inServerName = inServerName;
559            }
560    
561            @Override
562            public int getInServerPort() {
563                    return _inServerPort;
564            }
565    
566            @Override
567            public void setInServerPort(int inServerPort) {
568                    _inServerPort = inServerPort;
569            }
570    
571            @Override
572            public boolean getInUseSSL() {
573                    return _inUseSSL;
574            }
575    
576            @Override
577            public boolean isInUseSSL() {
578                    return _inUseSSL;
579            }
580    
581            @Override
582            public void setInUseSSL(boolean inUseSSL) {
583                    _inUseSSL = inUseSSL;
584            }
585    
586            @Override
587            public String getInUserName() {
588                    if (_inUserName == null) {
589                            return StringPool.BLANK;
590                    }
591                    else {
592                            return _inUserName;
593                    }
594            }
595    
596            @Override
597            public void setInUserName(String inUserName) {
598                    _inUserName = inUserName;
599            }
600    
601            @Override
602            public String getInPassword() {
603                    if (_inPassword == null) {
604                            return StringPool.BLANK;
605                    }
606                    else {
607                            return _inPassword;
608                    }
609            }
610    
611            @Override
612            public void setInPassword(String inPassword) {
613                    _inPassword = inPassword;
614            }
615    
616            @Override
617            public int getInReadInterval() {
618                    return _inReadInterval;
619            }
620    
621            @Override
622            public void setInReadInterval(int inReadInterval) {
623                    _inReadInterval = inReadInterval;
624            }
625    
626            @Override
627            public String getOutEmailAddress() {
628                    if (_outEmailAddress == null) {
629                            return StringPool.BLANK;
630                    }
631                    else {
632                            return _outEmailAddress;
633                    }
634            }
635    
636            @Override
637            public void setOutEmailAddress(String outEmailAddress) {
638                    _outEmailAddress = outEmailAddress;
639            }
640    
641            @Override
642            public boolean getOutCustom() {
643                    return _outCustom;
644            }
645    
646            @Override
647            public boolean isOutCustom() {
648                    return _outCustom;
649            }
650    
651            @Override
652            public void setOutCustom(boolean outCustom) {
653                    _outCustom = outCustom;
654            }
655    
656            @Override
657            public String getOutServerName() {
658                    if (_outServerName == null) {
659                            return StringPool.BLANK;
660                    }
661                    else {
662                            return _outServerName;
663                    }
664            }
665    
666            @Override
667            public void setOutServerName(String outServerName) {
668                    _outServerName = outServerName;
669            }
670    
671            @Override
672            public int getOutServerPort() {
673                    return _outServerPort;
674            }
675    
676            @Override
677            public void setOutServerPort(int outServerPort) {
678                    _outServerPort = outServerPort;
679            }
680    
681            @Override
682            public boolean getOutUseSSL() {
683                    return _outUseSSL;
684            }
685    
686            @Override
687            public boolean isOutUseSSL() {
688                    return _outUseSSL;
689            }
690    
691            @Override
692            public void setOutUseSSL(boolean outUseSSL) {
693                    _outUseSSL = outUseSSL;
694            }
695    
696            @Override
697            public String getOutUserName() {
698                    if (_outUserName == null) {
699                            return StringPool.BLANK;
700                    }
701                    else {
702                            return _outUserName;
703                    }
704            }
705    
706            @Override
707            public void setOutUserName(String outUserName) {
708                    _outUserName = outUserName;
709            }
710    
711            @Override
712            public String getOutPassword() {
713                    if (_outPassword == null) {
714                            return StringPool.BLANK;
715                    }
716                    else {
717                            return _outPassword;
718                    }
719            }
720    
721            @Override
722            public void setOutPassword(String outPassword) {
723                    _outPassword = outPassword;
724            }
725    
726            @Override
727            public boolean getAllowAnonymous() {
728                    return _allowAnonymous;
729            }
730    
731            @Override
732            public boolean isAllowAnonymous() {
733                    return _allowAnonymous;
734            }
735    
736            @Override
737            public void setAllowAnonymous(boolean allowAnonymous) {
738                    _allowAnonymous = allowAnonymous;
739            }
740    
741            @Override
742            public boolean getActive() {
743                    return _active;
744            }
745    
746            @Override
747            public boolean isActive() {
748                    return _active;
749            }
750    
751            @Override
752            public void setActive(boolean active) {
753                    _columnBitmask |= ACTIVE_COLUMN_BITMASK;
754    
755                    if (!_setOriginalActive) {
756                            _setOriginalActive = true;
757    
758                            _originalActive = _active;
759                    }
760    
761                    _active = active;
762            }
763    
764            public boolean getOriginalActive() {
765                    return _originalActive;
766            }
767    
768            @Override
769            public StagedModelType getStagedModelType() {
770                    return new StagedModelType(PortalUtil.getClassNameId(
771                                    MBMailingList.class.getName()));
772            }
773    
774            public long getColumnBitmask() {
775                    return _columnBitmask;
776            }
777    
778            @Override
779            public ExpandoBridge getExpandoBridge() {
780                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
781                            MBMailingList.class.getName(), getPrimaryKey());
782            }
783    
784            @Override
785            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
786                    ExpandoBridge expandoBridge = getExpandoBridge();
787    
788                    expandoBridge.setAttributes(serviceContext);
789            }
790    
791            @Override
792            public MBMailingList toEscapedModel() {
793                    if (_escapedModel == null) {
794                            _escapedModel = (MBMailingList)ProxyUtil.newProxyInstance(_classLoader,
795                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
796                    }
797    
798                    return _escapedModel;
799            }
800    
801            @Override
802            public Object clone() {
803                    MBMailingListImpl mbMailingListImpl = new MBMailingListImpl();
804    
805                    mbMailingListImpl.setUuid(getUuid());
806                    mbMailingListImpl.setMailingListId(getMailingListId());
807                    mbMailingListImpl.setGroupId(getGroupId());
808                    mbMailingListImpl.setCompanyId(getCompanyId());
809                    mbMailingListImpl.setUserId(getUserId());
810                    mbMailingListImpl.setUserName(getUserName());
811                    mbMailingListImpl.setCreateDate(getCreateDate());
812                    mbMailingListImpl.setModifiedDate(getModifiedDate());
813                    mbMailingListImpl.setCategoryId(getCategoryId());
814                    mbMailingListImpl.setEmailAddress(getEmailAddress());
815                    mbMailingListImpl.setInProtocol(getInProtocol());
816                    mbMailingListImpl.setInServerName(getInServerName());
817                    mbMailingListImpl.setInServerPort(getInServerPort());
818                    mbMailingListImpl.setInUseSSL(getInUseSSL());
819                    mbMailingListImpl.setInUserName(getInUserName());
820                    mbMailingListImpl.setInPassword(getInPassword());
821                    mbMailingListImpl.setInReadInterval(getInReadInterval());
822                    mbMailingListImpl.setOutEmailAddress(getOutEmailAddress());
823                    mbMailingListImpl.setOutCustom(getOutCustom());
824                    mbMailingListImpl.setOutServerName(getOutServerName());
825                    mbMailingListImpl.setOutServerPort(getOutServerPort());
826                    mbMailingListImpl.setOutUseSSL(getOutUseSSL());
827                    mbMailingListImpl.setOutUserName(getOutUserName());
828                    mbMailingListImpl.setOutPassword(getOutPassword());
829                    mbMailingListImpl.setAllowAnonymous(getAllowAnonymous());
830                    mbMailingListImpl.setActive(getActive());
831    
832                    mbMailingListImpl.resetOriginalValues();
833    
834                    return mbMailingListImpl;
835            }
836    
837            @Override
838            public int compareTo(MBMailingList mbMailingList) {
839                    long primaryKey = mbMailingList.getPrimaryKey();
840    
841                    if (getPrimaryKey() < primaryKey) {
842                            return -1;
843                    }
844                    else if (getPrimaryKey() > primaryKey) {
845                            return 1;
846                    }
847                    else {
848                            return 0;
849                    }
850            }
851    
852            @Override
853            public boolean equals(Object obj) {
854                    if (this == obj) {
855                            return true;
856                    }
857    
858                    if (!(obj instanceof MBMailingList)) {
859                            return false;
860                    }
861    
862                    MBMailingList mbMailingList = (MBMailingList)obj;
863    
864                    long primaryKey = mbMailingList.getPrimaryKey();
865    
866                    if (getPrimaryKey() == primaryKey) {
867                            return true;
868                    }
869                    else {
870                            return false;
871                    }
872            }
873    
874            @Override
875            public int hashCode() {
876                    return (int)getPrimaryKey();
877            }
878    
879            @Override
880            public boolean isEntityCacheEnabled() {
881                    return ENTITY_CACHE_ENABLED;
882            }
883    
884            @Override
885            public boolean isFinderCacheEnabled() {
886                    return FINDER_CACHE_ENABLED;
887            }
888    
889            @Override
890            public void resetOriginalValues() {
891                    MBMailingListModelImpl mbMailingListModelImpl = this;
892    
893                    mbMailingListModelImpl._originalUuid = mbMailingListModelImpl._uuid;
894    
895                    mbMailingListModelImpl._originalGroupId = mbMailingListModelImpl._groupId;
896    
897                    mbMailingListModelImpl._setOriginalGroupId = false;
898    
899                    mbMailingListModelImpl._originalCompanyId = mbMailingListModelImpl._companyId;
900    
901                    mbMailingListModelImpl._setOriginalCompanyId = false;
902    
903                    mbMailingListModelImpl._setModifiedDate = false;
904    
905                    mbMailingListModelImpl._originalCategoryId = mbMailingListModelImpl._categoryId;
906    
907                    mbMailingListModelImpl._setOriginalCategoryId = false;
908    
909                    mbMailingListModelImpl._originalActive = mbMailingListModelImpl._active;
910    
911                    mbMailingListModelImpl._setOriginalActive = false;
912    
913                    mbMailingListModelImpl._columnBitmask = 0;
914            }
915    
916            @Override
917            public CacheModel<MBMailingList> toCacheModel() {
918                    MBMailingListCacheModel mbMailingListCacheModel = new MBMailingListCacheModel();
919    
920                    mbMailingListCacheModel.uuid = getUuid();
921    
922                    String uuid = mbMailingListCacheModel.uuid;
923    
924                    if ((uuid != null) && (uuid.length() == 0)) {
925                            mbMailingListCacheModel.uuid = null;
926                    }
927    
928                    mbMailingListCacheModel.mailingListId = getMailingListId();
929    
930                    mbMailingListCacheModel.groupId = getGroupId();
931    
932                    mbMailingListCacheModel.companyId = getCompanyId();
933    
934                    mbMailingListCacheModel.userId = getUserId();
935    
936                    mbMailingListCacheModel.userName = getUserName();
937    
938                    String userName = mbMailingListCacheModel.userName;
939    
940                    if ((userName != null) && (userName.length() == 0)) {
941                            mbMailingListCacheModel.userName = null;
942                    }
943    
944                    Date createDate = getCreateDate();
945    
946                    if (createDate != null) {
947                            mbMailingListCacheModel.createDate = createDate.getTime();
948                    }
949                    else {
950                            mbMailingListCacheModel.createDate = Long.MIN_VALUE;
951                    }
952    
953                    Date modifiedDate = getModifiedDate();
954    
955                    if (modifiedDate != null) {
956                            mbMailingListCacheModel.modifiedDate = modifiedDate.getTime();
957                    }
958                    else {
959                            mbMailingListCacheModel.modifiedDate = Long.MIN_VALUE;
960                    }
961    
962                    mbMailingListCacheModel.categoryId = getCategoryId();
963    
964                    mbMailingListCacheModel.emailAddress = getEmailAddress();
965    
966                    String emailAddress = mbMailingListCacheModel.emailAddress;
967    
968                    if ((emailAddress != null) && (emailAddress.length() == 0)) {
969                            mbMailingListCacheModel.emailAddress = null;
970                    }
971    
972                    mbMailingListCacheModel.inProtocol = getInProtocol();
973    
974                    String inProtocol = mbMailingListCacheModel.inProtocol;
975    
976                    if ((inProtocol != null) && (inProtocol.length() == 0)) {
977                            mbMailingListCacheModel.inProtocol = null;
978                    }
979    
980                    mbMailingListCacheModel.inServerName = getInServerName();
981    
982                    String inServerName = mbMailingListCacheModel.inServerName;
983    
984                    if ((inServerName != null) && (inServerName.length() == 0)) {
985                            mbMailingListCacheModel.inServerName = null;
986                    }
987    
988                    mbMailingListCacheModel.inServerPort = getInServerPort();
989    
990                    mbMailingListCacheModel.inUseSSL = getInUseSSL();
991    
992                    mbMailingListCacheModel.inUserName = getInUserName();
993    
994                    String inUserName = mbMailingListCacheModel.inUserName;
995    
996                    if ((inUserName != null) && (inUserName.length() == 0)) {
997                            mbMailingListCacheModel.inUserName = null;
998                    }
999    
1000                    mbMailingListCacheModel.inPassword = getInPassword();
1001    
1002                    String inPassword = mbMailingListCacheModel.inPassword;
1003    
1004                    if ((inPassword != null) && (inPassword.length() == 0)) {
1005                            mbMailingListCacheModel.inPassword = null;
1006                    }
1007    
1008                    mbMailingListCacheModel.inReadInterval = getInReadInterval();
1009    
1010                    mbMailingListCacheModel.outEmailAddress = getOutEmailAddress();
1011    
1012                    String outEmailAddress = mbMailingListCacheModel.outEmailAddress;
1013    
1014                    if ((outEmailAddress != null) && (outEmailAddress.length() == 0)) {
1015                            mbMailingListCacheModel.outEmailAddress = null;
1016                    }
1017    
1018                    mbMailingListCacheModel.outCustom = getOutCustom();
1019    
1020                    mbMailingListCacheModel.outServerName = getOutServerName();
1021    
1022                    String outServerName = mbMailingListCacheModel.outServerName;
1023    
1024                    if ((outServerName != null) && (outServerName.length() == 0)) {
1025                            mbMailingListCacheModel.outServerName = null;
1026                    }
1027    
1028                    mbMailingListCacheModel.outServerPort = getOutServerPort();
1029    
1030                    mbMailingListCacheModel.outUseSSL = getOutUseSSL();
1031    
1032                    mbMailingListCacheModel.outUserName = getOutUserName();
1033    
1034                    String outUserName = mbMailingListCacheModel.outUserName;
1035    
1036                    if ((outUserName != null) && (outUserName.length() == 0)) {
1037                            mbMailingListCacheModel.outUserName = null;
1038                    }
1039    
1040                    mbMailingListCacheModel.outPassword = getOutPassword();
1041    
1042                    String outPassword = mbMailingListCacheModel.outPassword;
1043    
1044                    if ((outPassword != null) && (outPassword.length() == 0)) {
1045                            mbMailingListCacheModel.outPassword = null;
1046                    }
1047    
1048                    mbMailingListCacheModel.allowAnonymous = getAllowAnonymous();
1049    
1050                    mbMailingListCacheModel.active = getActive();
1051    
1052                    return mbMailingListCacheModel;
1053            }
1054    
1055            @Override
1056            public String toString() {
1057                    StringBundler sb = new StringBundler(53);
1058    
1059                    sb.append("{uuid=");
1060                    sb.append(getUuid());
1061                    sb.append(", mailingListId=");
1062                    sb.append(getMailingListId());
1063                    sb.append(", groupId=");
1064                    sb.append(getGroupId());
1065                    sb.append(", companyId=");
1066                    sb.append(getCompanyId());
1067                    sb.append(", userId=");
1068                    sb.append(getUserId());
1069                    sb.append(", userName=");
1070                    sb.append(getUserName());
1071                    sb.append(", createDate=");
1072                    sb.append(getCreateDate());
1073                    sb.append(", modifiedDate=");
1074                    sb.append(getModifiedDate());
1075                    sb.append(", categoryId=");
1076                    sb.append(getCategoryId());
1077                    sb.append(", emailAddress=");
1078                    sb.append(getEmailAddress());
1079                    sb.append(", inProtocol=");
1080                    sb.append(getInProtocol());
1081                    sb.append(", inServerName=");
1082                    sb.append(getInServerName());
1083                    sb.append(", inServerPort=");
1084                    sb.append(getInServerPort());
1085                    sb.append(", inUseSSL=");
1086                    sb.append(getInUseSSL());
1087                    sb.append(", inUserName=");
1088                    sb.append(getInUserName());
1089                    sb.append(", inPassword=");
1090                    sb.append(getInPassword());
1091                    sb.append(", inReadInterval=");
1092                    sb.append(getInReadInterval());
1093                    sb.append(", outEmailAddress=");
1094                    sb.append(getOutEmailAddress());
1095                    sb.append(", outCustom=");
1096                    sb.append(getOutCustom());
1097                    sb.append(", outServerName=");
1098                    sb.append(getOutServerName());
1099                    sb.append(", outServerPort=");
1100                    sb.append(getOutServerPort());
1101                    sb.append(", outUseSSL=");
1102                    sb.append(getOutUseSSL());
1103                    sb.append(", outUserName=");
1104                    sb.append(getOutUserName());
1105                    sb.append(", outPassword=");
1106                    sb.append(getOutPassword());
1107                    sb.append(", allowAnonymous=");
1108                    sb.append(getAllowAnonymous());
1109                    sb.append(", active=");
1110                    sb.append(getActive());
1111                    sb.append("}");
1112    
1113                    return sb.toString();
1114            }
1115    
1116            @Override
1117            public String toXmlString() {
1118                    StringBundler sb = new StringBundler(82);
1119    
1120                    sb.append("<model><model-name>");
1121                    sb.append("com.liferay.portlet.messageboards.model.MBMailingList");
1122                    sb.append("</model-name>");
1123    
1124                    sb.append(
1125                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1126                    sb.append(getUuid());
1127                    sb.append("]]></column-value></column>");
1128                    sb.append(
1129                            "<column><column-name>mailingListId</column-name><column-value><![CDATA[");
1130                    sb.append(getMailingListId());
1131                    sb.append("]]></column-value></column>");
1132                    sb.append(
1133                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1134                    sb.append(getGroupId());
1135                    sb.append("]]></column-value></column>");
1136                    sb.append(
1137                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1138                    sb.append(getCompanyId());
1139                    sb.append("]]></column-value></column>");
1140                    sb.append(
1141                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1142                    sb.append(getUserId());
1143                    sb.append("]]></column-value></column>");
1144                    sb.append(
1145                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1146                    sb.append(getUserName());
1147                    sb.append("]]></column-value></column>");
1148                    sb.append(
1149                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1150                    sb.append(getCreateDate());
1151                    sb.append("]]></column-value></column>");
1152                    sb.append(
1153                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1154                    sb.append(getModifiedDate());
1155                    sb.append("]]></column-value></column>");
1156                    sb.append(
1157                            "<column><column-name>categoryId</column-name><column-value><![CDATA[");
1158                    sb.append(getCategoryId());
1159                    sb.append("]]></column-value></column>");
1160                    sb.append(
1161                            "<column><column-name>emailAddress</column-name><column-value><![CDATA[");
1162                    sb.append(getEmailAddress());
1163                    sb.append("]]></column-value></column>");
1164                    sb.append(
1165                            "<column><column-name>inProtocol</column-name><column-value><![CDATA[");
1166                    sb.append(getInProtocol());
1167                    sb.append("]]></column-value></column>");
1168                    sb.append(
1169                            "<column><column-name>inServerName</column-name><column-value><![CDATA[");
1170                    sb.append(getInServerName());
1171                    sb.append("]]></column-value></column>");
1172                    sb.append(
1173                            "<column><column-name>inServerPort</column-name><column-value><![CDATA[");
1174                    sb.append(getInServerPort());
1175                    sb.append("]]></column-value></column>");
1176                    sb.append(
1177                            "<column><column-name>inUseSSL</column-name><column-value><![CDATA[");
1178                    sb.append(getInUseSSL());
1179                    sb.append("]]></column-value></column>");
1180                    sb.append(
1181                            "<column><column-name>inUserName</column-name><column-value><![CDATA[");
1182                    sb.append(getInUserName());
1183                    sb.append("]]></column-value></column>");
1184                    sb.append(
1185                            "<column><column-name>inPassword</column-name><column-value><![CDATA[");
1186                    sb.append(getInPassword());
1187                    sb.append("]]></column-value></column>");
1188                    sb.append(
1189                            "<column><column-name>inReadInterval</column-name><column-value><![CDATA[");
1190                    sb.append(getInReadInterval());
1191                    sb.append("]]></column-value></column>");
1192                    sb.append(
1193                            "<column><column-name>outEmailAddress</column-name><column-value><![CDATA[");
1194                    sb.append(getOutEmailAddress());
1195                    sb.append("]]></column-value></column>");
1196                    sb.append(
1197                            "<column><column-name>outCustom</column-name><column-value><![CDATA[");
1198                    sb.append(getOutCustom());
1199                    sb.append("]]></column-value></column>");
1200                    sb.append(
1201                            "<column><column-name>outServerName</column-name><column-value><![CDATA[");
1202                    sb.append(getOutServerName());
1203                    sb.append("]]></column-value></column>");
1204                    sb.append(
1205                            "<column><column-name>outServerPort</column-name><column-value><![CDATA[");
1206                    sb.append(getOutServerPort());
1207                    sb.append("]]></column-value></column>");
1208                    sb.append(
1209                            "<column><column-name>outUseSSL</column-name><column-value><![CDATA[");
1210                    sb.append(getOutUseSSL());
1211                    sb.append("]]></column-value></column>");
1212                    sb.append(
1213                            "<column><column-name>outUserName</column-name><column-value><![CDATA[");
1214                    sb.append(getOutUserName());
1215                    sb.append("]]></column-value></column>");
1216                    sb.append(
1217                            "<column><column-name>outPassword</column-name><column-value><![CDATA[");
1218                    sb.append(getOutPassword());
1219                    sb.append("]]></column-value></column>");
1220                    sb.append(
1221                            "<column><column-name>allowAnonymous</column-name><column-value><![CDATA[");
1222                    sb.append(getAllowAnonymous());
1223                    sb.append("]]></column-value></column>");
1224                    sb.append(
1225                            "<column><column-name>active</column-name><column-value><![CDATA[");
1226                    sb.append(getActive());
1227                    sb.append("]]></column-value></column>");
1228    
1229                    sb.append("</model>");
1230    
1231                    return sb.toString();
1232            }
1233    
1234            private static final ClassLoader _classLoader = MBMailingList.class.getClassLoader();
1235            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1236                            MBMailingList.class
1237                    };
1238            private String _uuid;
1239            private String _originalUuid;
1240            private long _mailingListId;
1241            private long _groupId;
1242            private long _originalGroupId;
1243            private boolean _setOriginalGroupId;
1244            private long _companyId;
1245            private long _originalCompanyId;
1246            private boolean _setOriginalCompanyId;
1247            private long _userId;
1248            private String _userName;
1249            private Date _createDate;
1250            private Date _modifiedDate;
1251            private boolean _setModifiedDate;
1252            private long _categoryId;
1253            private long _originalCategoryId;
1254            private boolean _setOriginalCategoryId;
1255            private String _emailAddress;
1256            private String _inProtocol;
1257            private String _inServerName;
1258            private int _inServerPort;
1259            private boolean _inUseSSL;
1260            private String _inUserName;
1261            private String _inPassword;
1262            private int _inReadInterval;
1263            private String _outEmailAddress;
1264            private boolean _outCustom;
1265            private String _outServerName;
1266            private int _outServerPort;
1267            private boolean _outUseSSL;
1268            private String _outUserName;
1269            private String _outPassword;
1270            private boolean _allowAnonymous;
1271            private boolean _active;
1272            private boolean _originalActive;
1273            private boolean _setOriginalActive;
1274            private long _columnBitmask;
1275            private MBMailingList _escapedModel;
1276    }