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