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