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