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