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.lar.StagedModelType;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.ProxyUtil;
024    import com.liferay.portal.kernel.util.StringBundler;
025    import com.liferay.portal.kernel.util.StringPool;
026    import com.liferay.portal.model.CacheModel;
027    import com.liferay.portal.model.User;
028    import com.liferay.portal.model.impl.BaseModelImpl;
029    import com.liferay.portal.service.ServiceContext;
030    import com.liferay.portal.service.UserLocalServiceUtil;
031    import com.liferay.portal.util.PortalUtil;
032    
033    import com.liferay.portlet.expando.model.ExpandoBridge;
034    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
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 com.liferay.portlet.messageboards.model.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 com.liferay.portlet.messageboards.model.MBMailingList
056     * @see com.liferay.portlet.messageboards.model.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 com.liferay.portlet.messageboards.model.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            @Override
484            public void setModifiedDate(Date modifiedDate) {
485                    _modifiedDate = modifiedDate;
486            }
487    
488            @Override
489            public long getCategoryId() {
490                    return _categoryId;
491            }
492    
493            @Override
494            public void setCategoryId(long categoryId) {
495                    _columnBitmask |= CATEGORYID_COLUMN_BITMASK;
496    
497                    if (!_setOriginalCategoryId) {
498                            _setOriginalCategoryId = true;
499    
500                            _originalCategoryId = _categoryId;
501                    }
502    
503                    _categoryId = categoryId;
504            }
505    
506            public long getOriginalCategoryId() {
507                    return _originalCategoryId;
508            }
509    
510            @Override
511            public String getEmailAddress() {
512                    if (_emailAddress == null) {
513                            return StringPool.BLANK;
514                    }
515                    else {
516                            return _emailAddress;
517                    }
518            }
519    
520            @Override
521            public void setEmailAddress(String emailAddress) {
522                    _emailAddress = emailAddress;
523            }
524    
525            @Override
526            public String getInProtocol() {
527                    if (_inProtocol == null) {
528                            return StringPool.BLANK;
529                    }
530                    else {
531                            return _inProtocol;
532                    }
533            }
534    
535            @Override
536            public void setInProtocol(String inProtocol) {
537                    _inProtocol = inProtocol;
538            }
539    
540            @Override
541            public String getInServerName() {
542                    if (_inServerName == null) {
543                            return StringPool.BLANK;
544                    }
545                    else {
546                            return _inServerName;
547                    }
548            }
549    
550            @Override
551            public void setInServerName(String inServerName) {
552                    _inServerName = inServerName;
553            }
554    
555            @Override
556            public int getInServerPort() {
557                    return _inServerPort;
558            }
559    
560            @Override
561            public void setInServerPort(int inServerPort) {
562                    _inServerPort = inServerPort;
563            }
564    
565            @Override
566            public boolean getInUseSSL() {
567                    return _inUseSSL;
568            }
569    
570            @Override
571            public boolean isInUseSSL() {
572                    return _inUseSSL;
573            }
574    
575            @Override
576            public void setInUseSSL(boolean inUseSSL) {
577                    _inUseSSL = inUseSSL;
578            }
579    
580            @Override
581            public String getInUserName() {
582                    if (_inUserName == null) {
583                            return StringPool.BLANK;
584                    }
585                    else {
586                            return _inUserName;
587                    }
588            }
589    
590            @Override
591            public void setInUserName(String inUserName) {
592                    _inUserName = inUserName;
593            }
594    
595            @Override
596            public String getInPassword() {
597                    if (_inPassword == null) {
598                            return StringPool.BLANK;
599                    }
600                    else {
601                            return _inPassword;
602                    }
603            }
604    
605            @Override
606            public void setInPassword(String inPassword) {
607                    _inPassword = inPassword;
608            }
609    
610            @Override
611            public int getInReadInterval() {
612                    return _inReadInterval;
613            }
614    
615            @Override
616            public void setInReadInterval(int inReadInterval) {
617                    _inReadInterval = inReadInterval;
618            }
619    
620            @Override
621            public String getOutEmailAddress() {
622                    if (_outEmailAddress == null) {
623                            return StringPool.BLANK;
624                    }
625                    else {
626                            return _outEmailAddress;
627                    }
628            }
629    
630            @Override
631            public void setOutEmailAddress(String outEmailAddress) {
632                    _outEmailAddress = outEmailAddress;
633            }
634    
635            @Override
636            public boolean getOutCustom() {
637                    return _outCustom;
638            }
639    
640            @Override
641            public boolean isOutCustom() {
642                    return _outCustom;
643            }
644    
645            @Override
646            public void setOutCustom(boolean outCustom) {
647                    _outCustom = outCustom;
648            }
649    
650            @Override
651            public String getOutServerName() {
652                    if (_outServerName == null) {
653                            return StringPool.BLANK;
654                    }
655                    else {
656                            return _outServerName;
657                    }
658            }
659    
660            @Override
661            public void setOutServerName(String outServerName) {
662                    _outServerName = outServerName;
663            }
664    
665            @Override
666            public int getOutServerPort() {
667                    return _outServerPort;
668            }
669    
670            @Override
671            public void setOutServerPort(int outServerPort) {
672                    _outServerPort = outServerPort;
673            }
674    
675            @Override
676            public boolean getOutUseSSL() {
677                    return _outUseSSL;
678            }
679    
680            @Override
681            public boolean isOutUseSSL() {
682                    return _outUseSSL;
683            }
684    
685            @Override
686            public void setOutUseSSL(boolean outUseSSL) {
687                    _outUseSSL = outUseSSL;
688            }
689    
690            @Override
691            public String getOutUserName() {
692                    if (_outUserName == null) {
693                            return StringPool.BLANK;
694                    }
695                    else {
696                            return _outUserName;
697                    }
698            }
699    
700            @Override
701            public void setOutUserName(String outUserName) {
702                    _outUserName = outUserName;
703            }
704    
705            @Override
706            public String getOutPassword() {
707                    if (_outPassword == null) {
708                            return StringPool.BLANK;
709                    }
710                    else {
711                            return _outPassword;
712                    }
713            }
714    
715            @Override
716            public void setOutPassword(String outPassword) {
717                    _outPassword = outPassword;
718            }
719    
720            @Override
721            public boolean getAllowAnonymous() {
722                    return _allowAnonymous;
723            }
724    
725            @Override
726            public boolean isAllowAnonymous() {
727                    return _allowAnonymous;
728            }
729    
730            @Override
731            public void setAllowAnonymous(boolean allowAnonymous) {
732                    _allowAnonymous = allowAnonymous;
733            }
734    
735            @Override
736            public boolean getActive() {
737                    return _active;
738            }
739    
740            @Override
741            public boolean isActive() {
742                    return _active;
743            }
744    
745            @Override
746            public void setActive(boolean active) {
747                    _columnBitmask |= ACTIVE_COLUMN_BITMASK;
748    
749                    if (!_setOriginalActive) {
750                            _setOriginalActive = true;
751    
752                            _originalActive = _active;
753                    }
754    
755                    _active = active;
756            }
757    
758            public boolean getOriginalActive() {
759                    return _originalActive;
760            }
761    
762            @Override
763            public StagedModelType getStagedModelType() {
764                    return new StagedModelType(PortalUtil.getClassNameId(
765                                    MBMailingList.class.getName()));
766            }
767    
768            public long getColumnBitmask() {
769                    return _columnBitmask;
770            }
771    
772            @Override
773            public ExpandoBridge getExpandoBridge() {
774                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
775                            MBMailingList.class.getName(), getPrimaryKey());
776            }
777    
778            @Override
779            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
780                    ExpandoBridge expandoBridge = getExpandoBridge();
781    
782                    expandoBridge.setAttributes(serviceContext);
783            }
784    
785            @Override
786            public MBMailingList toEscapedModel() {
787                    if (_escapedModel == null) {
788                            _escapedModel = (MBMailingList)ProxyUtil.newProxyInstance(_classLoader,
789                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
790                    }
791    
792                    return _escapedModel;
793            }
794    
795            @Override
796            public Object clone() {
797                    MBMailingListImpl mbMailingListImpl = new MBMailingListImpl();
798    
799                    mbMailingListImpl.setUuid(getUuid());
800                    mbMailingListImpl.setMailingListId(getMailingListId());
801                    mbMailingListImpl.setGroupId(getGroupId());
802                    mbMailingListImpl.setCompanyId(getCompanyId());
803                    mbMailingListImpl.setUserId(getUserId());
804                    mbMailingListImpl.setUserName(getUserName());
805                    mbMailingListImpl.setCreateDate(getCreateDate());
806                    mbMailingListImpl.setModifiedDate(getModifiedDate());
807                    mbMailingListImpl.setCategoryId(getCategoryId());
808                    mbMailingListImpl.setEmailAddress(getEmailAddress());
809                    mbMailingListImpl.setInProtocol(getInProtocol());
810                    mbMailingListImpl.setInServerName(getInServerName());
811                    mbMailingListImpl.setInServerPort(getInServerPort());
812                    mbMailingListImpl.setInUseSSL(getInUseSSL());
813                    mbMailingListImpl.setInUserName(getInUserName());
814                    mbMailingListImpl.setInPassword(getInPassword());
815                    mbMailingListImpl.setInReadInterval(getInReadInterval());
816                    mbMailingListImpl.setOutEmailAddress(getOutEmailAddress());
817                    mbMailingListImpl.setOutCustom(getOutCustom());
818                    mbMailingListImpl.setOutServerName(getOutServerName());
819                    mbMailingListImpl.setOutServerPort(getOutServerPort());
820                    mbMailingListImpl.setOutUseSSL(getOutUseSSL());
821                    mbMailingListImpl.setOutUserName(getOutUserName());
822                    mbMailingListImpl.setOutPassword(getOutPassword());
823                    mbMailingListImpl.setAllowAnonymous(getAllowAnonymous());
824                    mbMailingListImpl.setActive(getActive());
825    
826                    mbMailingListImpl.resetOriginalValues();
827    
828                    return mbMailingListImpl;
829            }
830    
831            @Override
832            public int compareTo(MBMailingList mbMailingList) {
833                    long primaryKey = mbMailingList.getPrimaryKey();
834    
835                    if (getPrimaryKey() < primaryKey) {
836                            return -1;
837                    }
838                    else if (getPrimaryKey() > primaryKey) {
839                            return 1;
840                    }
841                    else {
842                            return 0;
843                    }
844            }
845    
846            @Override
847            public boolean equals(Object obj) {
848                    if (this == obj) {
849                            return true;
850                    }
851    
852                    if (!(obj instanceof MBMailingList)) {
853                            return false;
854                    }
855    
856                    MBMailingList mbMailingList = (MBMailingList)obj;
857    
858                    long primaryKey = mbMailingList.getPrimaryKey();
859    
860                    if (getPrimaryKey() == primaryKey) {
861                            return true;
862                    }
863                    else {
864                            return false;
865                    }
866            }
867    
868            @Override
869            public int hashCode() {
870                    return (int)getPrimaryKey();
871            }
872    
873            @Override
874            public boolean isEntityCacheEnabled() {
875                    return ENTITY_CACHE_ENABLED;
876            }
877    
878            @Override
879            public boolean isFinderCacheEnabled() {
880                    return FINDER_CACHE_ENABLED;
881            }
882    
883            @Override
884            public void resetOriginalValues() {
885                    MBMailingListModelImpl mbMailingListModelImpl = this;
886    
887                    mbMailingListModelImpl._originalUuid = mbMailingListModelImpl._uuid;
888    
889                    mbMailingListModelImpl._originalGroupId = mbMailingListModelImpl._groupId;
890    
891                    mbMailingListModelImpl._setOriginalGroupId = false;
892    
893                    mbMailingListModelImpl._originalCompanyId = mbMailingListModelImpl._companyId;
894    
895                    mbMailingListModelImpl._setOriginalCompanyId = false;
896    
897                    mbMailingListModelImpl._originalCategoryId = mbMailingListModelImpl._categoryId;
898    
899                    mbMailingListModelImpl._setOriginalCategoryId = false;
900    
901                    mbMailingListModelImpl._originalActive = mbMailingListModelImpl._active;
902    
903                    mbMailingListModelImpl._setOriginalActive = false;
904    
905                    mbMailingListModelImpl._columnBitmask = 0;
906            }
907    
908            @Override
909            public CacheModel<MBMailingList> toCacheModel() {
910                    MBMailingListCacheModel mbMailingListCacheModel = new MBMailingListCacheModel();
911    
912                    mbMailingListCacheModel.uuid = getUuid();
913    
914                    String uuid = mbMailingListCacheModel.uuid;
915    
916                    if ((uuid != null) && (uuid.length() == 0)) {
917                            mbMailingListCacheModel.uuid = null;
918                    }
919    
920                    mbMailingListCacheModel.mailingListId = getMailingListId();
921    
922                    mbMailingListCacheModel.groupId = getGroupId();
923    
924                    mbMailingListCacheModel.companyId = getCompanyId();
925    
926                    mbMailingListCacheModel.userId = getUserId();
927    
928                    mbMailingListCacheModel.userName = getUserName();
929    
930                    String userName = mbMailingListCacheModel.userName;
931    
932                    if ((userName != null) && (userName.length() == 0)) {
933                            mbMailingListCacheModel.userName = null;
934                    }
935    
936                    Date createDate = getCreateDate();
937    
938                    if (createDate != null) {
939                            mbMailingListCacheModel.createDate = createDate.getTime();
940                    }
941                    else {
942                            mbMailingListCacheModel.createDate = Long.MIN_VALUE;
943                    }
944    
945                    Date modifiedDate = getModifiedDate();
946    
947                    if (modifiedDate != null) {
948                            mbMailingListCacheModel.modifiedDate = modifiedDate.getTime();
949                    }
950                    else {
951                            mbMailingListCacheModel.modifiedDate = Long.MIN_VALUE;
952                    }
953    
954                    mbMailingListCacheModel.categoryId = getCategoryId();
955    
956                    mbMailingListCacheModel.emailAddress = getEmailAddress();
957    
958                    String emailAddress = mbMailingListCacheModel.emailAddress;
959    
960                    if ((emailAddress != null) && (emailAddress.length() == 0)) {
961                            mbMailingListCacheModel.emailAddress = null;
962                    }
963    
964                    mbMailingListCacheModel.inProtocol = getInProtocol();
965    
966                    String inProtocol = mbMailingListCacheModel.inProtocol;
967    
968                    if ((inProtocol != null) && (inProtocol.length() == 0)) {
969                            mbMailingListCacheModel.inProtocol = null;
970                    }
971    
972                    mbMailingListCacheModel.inServerName = getInServerName();
973    
974                    String inServerName = mbMailingListCacheModel.inServerName;
975    
976                    if ((inServerName != null) && (inServerName.length() == 0)) {
977                            mbMailingListCacheModel.inServerName = null;
978                    }
979    
980                    mbMailingListCacheModel.inServerPort = getInServerPort();
981    
982                    mbMailingListCacheModel.inUseSSL = getInUseSSL();
983    
984                    mbMailingListCacheModel.inUserName = getInUserName();
985    
986                    String inUserName = mbMailingListCacheModel.inUserName;
987    
988                    if ((inUserName != null) && (inUserName.length() == 0)) {
989                            mbMailingListCacheModel.inUserName = null;
990                    }
991    
992                    mbMailingListCacheModel.inPassword = getInPassword();
993    
994                    String inPassword = mbMailingListCacheModel.inPassword;
995    
996                    if ((inPassword != null) && (inPassword.length() == 0)) {
997                            mbMailingListCacheModel.inPassword = null;
998                    }
999    
1000                    mbMailingListCacheModel.inReadInterval = getInReadInterval();
1001    
1002                    mbMailingListCacheModel.outEmailAddress = getOutEmailAddress();
1003    
1004                    String outEmailAddress = mbMailingListCacheModel.outEmailAddress;
1005    
1006                    if ((outEmailAddress != null) && (outEmailAddress.length() == 0)) {
1007                            mbMailingListCacheModel.outEmailAddress = null;
1008                    }
1009    
1010                    mbMailingListCacheModel.outCustom = getOutCustom();
1011    
1012                    mbMailingListCacheModel.outServerName = getOutServerName();
1013    
1014                    String outServerName = mbMailingListCacheModel.outServerName;
1015    
1016                    if ((outServerName != null) && (outServerName.length() == 0)) {
1017                            mbMailingListCacheModel.outServerName = null;
1018                    }
1019    
1020                    mbMailingListCacheModel.outServerPort = getOutServerPort();
1021    
1022                    mbMailingListCacheModel.outUseSSL = getOutUseSSL();
1023    
1024                    mbMailingListCacheModel.outUserName = getOutUserName();
1025    
1026                    String outUserName = mbMailingListCacheModel.outUserName;
1027    
1028                    if ((outUserName != null) && (outUserName.length() == 0)) {
1029                            mbMailingListCacheModel.outUserName = null;
1030                    }
1031    
1032                    mbMailingListCacheModel.outPassword = getOutPassword();
1033    
1034                    String outPassword = mbMailingListCacheModel.outPassword;
1035    
1036                    if ((outPassword != null) && (outPassword.length() == 0)) {
1037                            mbMailingListCacheModel.outPassword = null;
1038                    }
1039    
1040                    mbMailingListCacheModel.allowAnonymous = getAllowAnonymous();
1041    
1042                    mbMailingListCacheModel.active = getActive();
1043    
1044                    return mbMailingListCacheModel;
1045            }
1046    
1047            @Override
1048            public String toString() {
1049                    StringBundler sb = new StringBundler(53);
1050    
1051                    sb.append("{uuid=");
1052                    sb.append(getUuid());
1053                    sb.append(", mailingListId=");
1054                    sb.append(getMailingListId());
1055                    sb.append(", groupId=");
1056                    sb.append(getGroupId());
1057                    sb.append(", companyId=");
1058                    sb.append(getCompanyId());
1059                    sb.append(", userId=");
1060                    sb.append(getUserId());
1061                    sb.append(", userName=");
1062                    sb.append(getUserName());
1063                    sb.append(", createDate=");
1064                    sb.append(getCreateDate());
1065                    sb.append(", modifiedDate=");
1066                    sb.append(getModifiedDate());
1067                    sb.append(", categoryId=");
1068                    sb.append(getCategoryId());
1069                    sb.append(", emailAddress=");
1070                    sb.append(getEmailAddress());
1071                    sb.append(", inProtocol=");
1072                    sb.append(getInProtocol());
1073                    sb.append(", inServerName=");
1074                    sb.append(getInServerName());
1075                    sb.append(", inServerPort=");
1076                    sb.append(getInServerPort());
1077                    sb.append(", inUseSSL=");
1078                    sb.append(getInUseSSL());
1079                    sb.append(", inUserName=");
1080                    sb.append(getInUserName());
1081                    sb.append(", inPassword=");
1082                    sb.append(getInPassword());
1083                    sb.append(", inReadInterval=");
1084                    sb.append(getInReadInterval());
1085                    sb.append(", outEmailAddress=");
1086                    sb.append(getOutEmailAddress());
1087                    sb.append(", outCustom=");
1088                    sb.append(getOutCustom());
1089                    sb.append(", outServerName=");
1090                    sb.append(getOutServerName());
1091                    sb.append(", outServerPort=");
1092                    sb.append(getOutServerPort());
1093                    sb.append(", outUseSSL=");
1094                    sb.append(getOutUseSSL());
1095                    sb.append(", outUserName=");
1096                    sb.append(getOutUserName());
1097                    sb.append(", outPassword=");
1098                    sb.append(getOutPassword());
1099                    sb.append(", allowAnonymous=");
1100                    sb.append(getAllowAnonymous());
1101                    sb.append(", active=");
1102                    sb.append(getActive());
1103                    sb.append("}");
1104    
1105                    return sb.toString();
1106            }
1107    
1108            @Override
1109            public String toXmlString() {
1110                    StringBundler sb = new StringBundler(82);
1111    
1112                    sb.append("<model><model-name>");
1113                    sb.append("com.liferay.portlet.messageboards.model.MBMailingList");
1114                    sb.append("</model-name>");
1115    
1116                    sb.append(
1117                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1118                    sb.append(getUuid());
1119                    sb.append("]]></column-value></column>");
1120                    sb.append(
1121                            "<column><column-name>mailingListId</column-name><column-value><![CDATA[");
1122                    sb.append(getMailingListId());
1123                    sb.append("]]></column-value></column>");
1124                    sb.append(
1125                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1126                    sb.append(getGroupId());
1127                    sb.append("]]></column-value></column>");
1128                    sb.append(
1129                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1130                    sb.append(getCompanyId());
1131                    sb.append("]]></column-value></column>");
1132                    sb.append(
1133                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1134                    sb.append(getUserId());
1135                    sb.append("]]></column-value></column>");
1136                    sb.append(
1137                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1138                    sb.append(getUserName());
1139                    sb.append("]]></column-value></column>");
1140                    sb.append(
1141                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1142                    sb.append(getCreateDate());
1143                    sb.append("]]></column-value></column>");
1144                    sb.append(
1145                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1146                    sb.append(getModifiedDate());
1147                    sb.append("]]></column-value></column>");
1148                    sb.append(
1149                            "<column><column-name>categoryId</column-name><column-value><![CDATA[");
1150                    sb.append(getCategoryId());
1151                    sb.append("]]></column-value></column>");
1152                    sb.append(
1153                            "<column><column-name>emailAddress</column-name><column-value><![CDATA[");
1154                    sb.append(getEmailAddress());
1155                    sb.append("]]></column-value></column>");
1156                    sb.append(
1157                            "<column><column-name>inProtocol</column-name><column-value><![CDATA[");
1158                    sb.append(getInProtocol());
1159                    sb.append("]]></column-value></column>");
1160                    sb.append(
1161                            "<column><column-name>inServerName</column-name><column-value><![CDATA[");
1162                    sb.append(getInServerName());
1163                    sb.append("]]></column-value></column>");
1164                    sb.append(
1165                            "<column><column-name>inServerPort</column-name><column-value><![CDATA[");
1166                    sb.append(getInServerPort());
1167                    sb.append("]]></column-value></column>");
1168                    sb.append(
1169                            "<column><column-name>inUseSSL</column-name><column-value><![CDATA[");
1170                    sb.append(getInUseSSL());
1171                    sb.append("]]></column-value></column>");
1172                    sb.append(
1173                            "<column><column-name>inUserName</column-name><column-value><![CDATA[");
1174                    sb.append(getInUserName());
1175                    sb.append("]]></column-value></column>");
1176                    sb.append(
1177                            "<column><column-name>inPassword</column-name><column-value><![CDATA[");
1178                    sb.append(getInPassword());
1179                    sb.append("]]></column-value></column>");
1180                    sb.append(
1181                            "<column><column-name>inReadInterval</column-name><column-value><![CDATA[");
1182                    sb.append(getInReadInterval());
1183                    sb.append("]]></column-value></column>");
1184                    sb.append(
1185                            "<column><column-name>outEmailAddress</column-name><column-value><![CDATA[");
1186                    sb.append(getOutEmailAddress());
1187                    sb.append("]]></column-value></column>");
1188                    sb.append(
1189                            "<column><column-name>outCustom</column-name><column-value><![CDATA[");
1190                    sb.append(getOutCustom());
1191                    sb.append("]]></column-value></column>");
1192                    sb.append(
1193                            "<column><column-name>outServerName</column-name><column-value><![CDATA[");
1194                    sb.append(getOutServerName());
1195                    sb.append("]]></column-value></column>");
1196                    sb.append(
1197                            "<column><column-name>outServerPort</column-name><column-value><![CDATA[");
1198                    sb.append(getOutServerPort());
1199                    sb.append("]]></column-value></column>");
1200                    sb.append(
1201                            "<column><column-name>outUseSSL</column-name><column-value><![CDATA[");
1202                    sb.append(getOutUseSSL());
1203                    sb.append("]]></column-value></column>");
1204                    sb.append(
1205                            "<column><column-name>outUserName</column-name><column-value><![CDATA[");
1206                    sb.append(getOutUserName());
1207                    sb.append("]]></column-value></column>");
1208                    sb.append(
1209                            "<column><column-name>outPassword</column-name><column-value><![CDATA[");
1210                    sb.append(getOutPassword());
1211                    sb.append("]]></column-value></column>");
1212                    sb.append(
1213                            "<column><column-name>allowAnonymous</column-name><column-value><![CDATA[");
1214                    sb.append(getAllowAnonymous());
1215                    sb.append("]]></column-value></column>");
1216                    sb.append(
1217                            "<column><column-name>active</column-name><column-value><![CDATA[");
1218                    sb.append(getActive());
1219                    sb.append("]]></column-value></column>");
1220    
1221                    sb.append("</model>");
1222    
1223                    return sb.toString();
1224            }
1225    
1226            private static final ClassLoader _classLoader = MBMailingList.class.getClassLoader();
1227            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1228                            MBMailingList.class
1229                    };
1230            private String _uuid;
1231            private String _originalUuid;
1232            private long _mailingListId;
1233            private long _groupId;
1234            private long _originalGroupId;
1235            private boolean _setOriginalGroupId;
1236            private long _companyId;
1237            private long _originalCompanyId;
1238            private boolean _setOriginalCompanyId;
1239            private long _userId;
1240            private String _userName;
1241            private Date _createDate;
1242            private Date _modifiedDate;
1243            private long _categoryId;
1244            private long _originalCategoryId;
1245            private boolean _setOriginalCategoryId;
1246            private String _emailAddress;
1247            private String _inProtocol;
1248            private String _inServerName;
1249            private int _inServerPort;
1250            private boolean _inUseSSL;
1251            private String _inUserName;
1252            private String _inPassword;
1253            private int _inReadInterval;
1254            private String _outEmailAddress;
1255            private boolean _outCustom;
1256            private String _outServerName;
1257            private int _outServerPort;
1258            private boolean _outUseSSL;
1259            private String _outUserName;
1260            private String _outPassword;
1261            private boolean _allowAnonymous;
1262            private boolean _active;
1263            private boolean _originalActive;
1264            private boolean _setOriginalActive;
1265            private long _columnBitmask;
1266            private MBMailingList _escapedModel;
1267    }