001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.messageboards.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.util.GetterUtil;
020    import com.liferay.portal.kernel.util.StringBundler;
021    import com.liferay.portal.kernel.util.StringPool;
022    import com.liferay.portal.model.impl.BaseModelImpl;
023    import com.liferay.portal.service.ServiceContext;
024    import com.liferay.portal.util.PortalUtil;
025    
026    import com.liferay.portlet.expando.model.ExpandoBridge;
027    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
028    import com.liferay.portlet.messageboards.model.MBMailingList;
029    import com.liferay.portlet.messageboards.model.MBMailingListModel;
030    
031    import java.io.Serializable;
032    
033    import java.lang.reflect.Proxy;
034    
035    import java.sql.Types;
036    
037    import java.util.Date;
038    
039    /**
040     * <p>
041     * This interface is a model that represents the MBMailingList table in the
042     * database.
043     * </p>
044     *
045     * @author    Brian Wing Shun Chan
046     * @see       MBMailingListImpl
047     * @see       com.liferay.portlet.messageboards.model.MBMailingList
048     * @see       com.liferay.portlet.messageboards.model.MBMailingListModel
049     * @generated
050     */
051    public class MBMailingListModelImpl extends BaseModelImpl<MBMailingList>
052            implements MBMailingListModel {
053            public static final String TABLE_NAME = "MBMailingList";
054            public static final Object[][] TABLE_COLUMNS = {
055                            { "uuid_", new Integer(Types.VARCHAR) },
056                            { "mailingListId", new Integer(Types.BIGINT) },
057                            { "groupId", new Integer(Types.BIGINT) },
058                            { "companyId", new Integer(Types.BIGINT) },
059                            { "userId", new Integer(Types.BIGINT) },
060                            { "userName", new Integer(Types.VARCHAR) },
061                            { "createDate", new Integer(Types.TIMESTAMP) },
062                            { "modifiedDate", new Integer(Types.TIMESTAMP) },
063                            { "categoryId", new Integer(Types.BIGINT) },
064                            { "emailAddress", new Integer(Types.VARCHAR) },
065                            { "inProtocol", new Integer(Types.VARCHAR) },
066                            { "inServerName", new Integer(Types.VARCHAR) },
067                            { "inServerPort", new Integer(Types.INTEGER) },
068                            { "inUseSSL", new Integer(Types.BOOLEAN) },
069                            { "inUserName", new Integer(Types.VARCHAR) },
070                            { "inPassword", new Integer(Types.VARCHAR) },
071                            { "inReadInterval", new Integer(Types.INTEGER) },
072                            { "outEmailAddress", new Integer(Types.VARCHAR) },
073                            { "outCustom", new Integer(Types.BOOLEAN) },
074                            { "outServerName", new Integer(Types.VARCHAR) },
075                            { "outServerPort", new Integer(Types.INTEGER) },
076                            { "outUseSSL", new Integer(Types.BOOLEAN) },
077                            { "outUserName", new Integer(Types.VARCHAR) },
078                            { "outPassword", new Integer(Types.VARCHAR) },
079                            { "active_", new Integer(Types.BOOLEAN) }
080                    };
081            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,active_ BOOLEAN)";
082            public static final String TABLE_SQL_DROP = "drop table MBMailingList";
083            public static final String DATA_SOURCE = "liferayDataSource";
084            public static final String SESSION_FACTORY = "liferaySessionFactory";
085            public static final String TX_MANAGER = "liferayTransactionManager";
086            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
087                                    "value.object.entity.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
088                            true);
089            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
090                                    "value.object.finder.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
091                            true);
092            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
093                                    "lock.expiration.time.com.liferay.portlet.messageboards.model.MBMailingList"));
094    
095            public MBMailingListModelImpl() {
096            }
097    
098            public long getPrimaryKey() {
099                    return _mailingListId;
100            }
101    
102            public void setPrimaryKey(long pk) {
103                    setMailingListId(pk);
104            }
105    
106            public Serializable getPrimaryKeyObj() {
107                    return new Long(_mailingListId);
108            }
109    
110            public String getUuid() {
111                    if (_uuid == null) {
112                            return StringPool.BLANK;
113                    }
114                    else {
115                            return _uuid;
116                    }
117            }
118    
119            public void setUuid(String uuid) {
120                    _uuid = uuid;
121    
122                    if (_originalUuid == null) {
123                            _originalUuid = uuid;
124                    }
125            }
126    
127            public String getOriginalUuid() {
128                    return GetterUtil.getString(_originalUuid);
129            }
130    
131            public long getMailingListId() {
132                    return _mailingListId;
133            }
134    
135            public void setMailingListId(long mailingListId) {
136                    _mailingListId = mailingListId;
137            }
138    
139            public long getGroupId() {
140                    return _groupId;
141            }
142    
143            public void setGroupId(long groupId) {
144                    _groupId = groupId;
145    
146                    if (!_setOriginalGroupId) {
147                            _setOriginalGroupId = true;
148    
149                            _originalGroupId = groupId;
150                    }
151            }
152    
153            public long getOriginalGroupId() {
154                    return _originalGroupId;
155            }
156    
157            public long getCompanyId() {
158                    return _companyId;
159            }
160    
161            public void setCompanyId(long companyId) {
162                    _companyId = companyId;
163            }
164    
165            public long getUserId() {
166                    return _userId;
167            }
168    
169            public void setUserId(long userId) {
170                    _userId = userId;
171            }
172    
173            public String getUserUuid() throws SystemException {
174                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
175            }
176    
177            public void setUserUuid(String userUuid) {
178                    _userUuid = userUuid;
179            }
180    
181            public String getUserName() {
182                    if (_userName == null) {
183                            return StringPool.BLANK;
184                    }
185                    else {
186                            return _userName;
187                    }
188            }
189    
190            public void setUserName(String userName) {
191                    _userName = userName;
192            }
193    
194            public Date getCreateDate() {
195                    return _createDate;
196            }
197    
198            public void setCreateDate(Date createDate) {
199                    _createDate = createDate;
200            }
201    
202            public Date getModifiedDate() {
203                    return _modifiedDate;
204            }
205    
206            public void setModifiedDate(Date modifiedDate) {
207                    _modifiedDate = modifiedDate;
208            }
209    
210            public long getCategoryId() {
211                    return _categoryId;
212            }
213    
214            public void setCategoryId(long categoryId) {
215                    _categoryId = categoryId;
216    
217                    if (!_setOriginalCategoryId) {
218                            _setOriginalCategoryId = true;
219    
220                            _originalCategoryId = categoryId;
221                    }
222            }
223    
224            public long getOriginalCategoryId() {
225                    return _originalCategoryId;
226            }
227    
228            public String getEmailAddress() {
229                    if (_emailAddress == null) {
230                            return StringPool.BLANK;
231                    }
232                    else {
233                            return _emailAddress;
234                    }
235            }
236    
237            public void setEmailAddress(String emailAddress) {
238                    _emailAddress = emailAddress;
239            }
240    
241            public String getInProtocol() {
242                    if (_inProtocol == null) {
243                            return StringPool.BLANK;
244                    }
245                    else {
246                            return _inProtocol;
247                    }
248            }
249    
250            public void setInProtocol(String inProtocol) {
251                    _inProtocol = inProtocol;
252            }
253    
254            public String getInServerName() {
255                    if (_inServerName == null) {
256                            return StringPool.BLANK;
257                    }
258                    else {
259                            return _inServerName;
260                    }
261            }
262    
263            public void setInServerName(String inServerName) {
264                    _inServerName = inServerName;
265            }
266    
267            public int getInServerPort() {
268                    return _inServerPort;
269            }
270    
271            public void setInServerPort(int inServerPort) {
272                    _inServerPort = inServerPort;
273            }
274    
275            public boolean getInUseSSL() {
276                    return _inUseSSL;
277            }
278    
279            public boolean isInUseSSL() {
280                    return _inUseSSL;
281            }
282    
283            public void setInUseSSL(boolean inUseSSL) {
284                    _inUseSSL = inUseSSL;
285            }
286    
287            public String getInUserName() {
288                    if (_inUserName == null) {
289                            return StringPool.BLANK;
290                    }
291                    else {
292                            return _inUserName;
293                    }
294            }
295    
296            public void setInUserName(String inUserName) {
297                    _inUserName = inUserName;
298            }
299    
300            public String getInPassword() {
301                    if (_inPassword == null) {
302                            return StringPool.BLANK;
303                    }
304                    else {
305                            return _inPassword;
306                    }
307            }
308    
309            public void setInPassword(String inPassword) {
310                    _inPassword = inPassword;
311            }
312    
313            public int getInReadInterval() {
314                    return _inReadInterval;
315            }
316    
317            public void setInReadInterval(int inReadInterval) {
318                    _inReadInterval = inReadInterval;
319            }
320    
321            public String getOutEmailAddress() {
322                    if (_outEmailAddress == null) {
323                            return StringPool.BLANK;
324                    }
325                    else {
326                            return _outEmailAddress;
327                    }
328            }
329    
330            public void setOutEmailAddress(String outEmailAddress) {
331                    _outEmailAddress = outEmailAddress;
332            }
333    
334            public boolean getOutCustom() {
335                    return _outCustom;
336            }
337    
338            public boolean isOutCustom() {
339                    return _outCustom;
340            }
341    
342            public void setOutCustom(boolean outCustom) {
343                    _outCustom = outCustom;
344            }
345    
346            public String getOutServerName() {
347                    if (_outServerName == null) {
348                            return StringPool.BLANK;
349                    }
350                    else {
351                            return _outServerName;
352                    }
353            }
354    
355            public void setOutServerName(String outServerName) {
356                    _outServerName = outServerName;
357            }
358    
359            public int getOutServerPort() {
360                    return _outServerPort;
361            }
362    
363            public void setOutServerPort(int outServerPort) {
364                    _outServerPort = outServerPort;
365            }
366    
367            public boolean getOutUseSSL() {
368                    return _outUseSSL;
369            }
370    
371            public boolean isOutUseSSL() {
372                    return _outUseSSL;
373            }
374    
375            public void setOutUseSSL(boolean outUseSSL) {
376                    _outUseSSL = outUseSSL;
377            }
378    
379            public String getOutUserName() {
380                    if (_outUserName == null) {
381                            return StringPool.BLANK;
382                    }
383                    else {
384                            return _outUserName;
385                    }
386            }
387    
388            public void setOutUserName(String outUserName) {
389                    _outUserName = outUserName;
390            }
391    
392            public String getOutPassword() {
393                    if (_outPassword == null) {
394                            return StringPool.BLANK;
395                    }
396                    else {
397                            return _outPassword;
398                    }
399            }
400    
401            public void setOutPassword(String outPassword) {
402                    _outPassword = outPassword;
403            }
404    
405            public boolean getActive() {
406                    return _active;
407            }
408    
409            public boolean isActive() {
410                    return _active;
411            }
412    
413            public void setActive(boolean active) {
414                    _active = active;
415            }
416    
417            public MBMailingList toEscapedModel() {
418                    if (isEscapedModel()) {
419                            return (MBMailingList)this;
420                    }
421                    else {
422                            return (MBMailingList)Proxy.newProxyInstance(MBMailingList.class.getClassLoader(),
423                                    new Class[] { MBMailingList.class },
424                                    new AutoEscapeBeanHandler(this));
425                    }
426            }
427    
428            public ExpandoBridge getExpandoBridge() {
429                    if (_expandoBridge == null) {
430                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
431                                            MBMailingList.class.getName(), getPrimaryKey());
432                    }
433    
434                    return _expandoBridge;
435            }
436    
437            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
438                    getExpandoBridge().setAttributes(serviceContext);
439            }
440    
441            public Object clone() {
442                    MBMailingListImpl clone = new MBMailingListImpl();
443    
444                    clone.setUuid(getUuid());
445                    clone.setMailingListId(getMailingListId());
446                    clone.setGroupId(getGroupId());
447                    clone.setCompanyId(getCompanyId());
448                    clone.setUserId(getUserId());
449                    clone.setUserName(getUserName());
450                    clone.setCreateDate(getCreateDate());
451                    clone.setModifiedDate(getModifiedDate());
452                    clone.setCategoryId(getCategoryId());
453                    clone.setEmailAddress(getEmailAddress());
454                    clone.setInProtocol(getInProtocol());
455                    clone.setInServerName(getInServerName());
456                    clone.setInServerPort(getInServerPort());
457                    clone.setInUseSSL(getInUseSSL());
458                    clone.setInUserName(getInUserName());
459                    clone.setInPassword(getInPassword());
460                    clone.setInReadInterval(getInReadInterval());
461                    clone.setOutEmailAddress(getOutEmailAddress());
462                    clone.setOutCustom(getOutCustom());
463                    clone.setOutServerName(getOutServerName());
464                    clone.setOutServerPort(getOutServerPort());
465                    clone.setOutUseSSL(getOutUseSSL());
466                    clone.setOutUserName(getOutUserName());
467                    clone.setOutPassword(getOutPassword());
468                    clone.setActive(getActive());
469    
470                    return clone;
471            }
472    
473            public int compareTo(MBMailingList mbMailingList) {
474                    long pk = mbMailingList.getPrimaryKey();
475    
476                    if (getPrimaryKey() < pk) {
477                            return -1;
478                    }
479                    else if (getPrimaryKey() > pk) {
480                            return 1;
481                    }
482                    else {
483                            return 0;
484                    }
485            }
486    
487            public boolean equals(Object obj) {
488                    if (obj == null) {
489                            return false;
490                    }
491    
492                    MBMailingList mbMailingList = null;
493    
494                    try {
495                            mbMailingList = (MBMailingList)obj;
496                    }
497                    catch (ClassCastException cce) {
498                            return false;
499                    }
500    
501                    long pk = mbMailingList.getPrimaryKey();
502    
503                    if (getPrimaryKey() == pk) {
504                            return true;
505                    }
506                    else {
507                            return false;
508                    }
509            }
510    
511            public int hashCode() {
512                    return (int)getPrimaryKey();
513            }
514    
515            public String toString() {
516                    StringBundler sb = new StringBundler(51);
517    
518                    sb.append("{uuid=");
519                    sb.append(getUuid());
520                    sb.append(", mailingListId=");
521                    sb.append(getMailingListId());
522                    sb.append(", groupId=");
523                    sb.append(getGroupId());
524                    sb.append(", companyId=");
525                    sb.append(getCompanyId());
526                    sb.append(", userId=");
527                    sb.append(getUserId());
528                    sb.append(", userName=");
529                    sb.append(getUserName());
530                    sb.append(", createDate=");
531                    sb.append(getCreateDate());
532                    sb.append(", modifiedDate=");
533                    sb.append(getModifiedDate());
534                    sb.append(", categoryId=");
535                    sb.append(getCategoryId());
536                    sb.append(", emailAddress=");
537                    sb.append(getEmailAddress());
538                    sb.append(", inProtocol=");
539                    sb.append(getInProtocol());
540                    sb.append(", inServerName=");
541                    sb.append(getInServerName());
542                    sb.append(", inServerPort=");
543                    sb.append(getInServerPort());
544                    sb.append(", inUseSSL=");
545                    sb.append(getInUseSSL());
546                    sb.append(", inUserName=");
547                    sb.append(getInUserName());
548                    sb.append(", inPassword=");
549                    sb.append(getInPassword());
550                    sb.append(", inReadInterval=");
551                    sb.append(getInReadInterval());
552                    sb.append(", outEmailAddress=");
553                    sb.append(getOutEmailAddress());
554                    sb.append(", outCustom=");
555                    sb.append(getOutCustom());
556                    sb.append(", outServerName=");
557                    sb.append(getOutServerName());
558                    sb.append(", outServerPort=");
559                    sb.append(getOutServerPort());
560                    sb.append(", outUseSSL=");
561                    sb.append(getOutUseSSL());
562                    sb.append(", outUserName=");
563                    sb.append(getOutUserName());
564                    sb.append(", outPassword=");
565                    sb.append(getOutPassword());
566                    sb.append(", active=");
567                    sb.append(getActive());
568                    sb.append("}");
569    
570                    return sb.toString();
571            }
572    
573            public String toXmlString() {
574                    StringBundler sb = new StringBundler(79);
575    
576                    sb.append("<model><model-name>");
577                    sb.append("com.liferay.portlet.messageboards.model.MBMailingList");
578                    sb.append("</model-name>");
579    
580                    sb.append(
581                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
582                    sb.append(getUuid());
583                    sb.append("]]></column-value></column>");
584                    sb.append(
585                            "<column><column-name>mailingListId</column-name><column-value><![CDATA[");
586                    sb.append(getMailingListId());
587                    sb.append("]]></column-value></column>");
588                    sb.append(
589                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
590                    sb.append(getGroupId());
591                    sb.append("]]></column-value></column>");
592                    sb.append(
593                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
594                    sb.append(getCompanyId());
595                    sb.append("]]></column-value></column>");
596                    sb.append(
597                            "<column><column-name>userId</column-name><column-value><![CDATA[");
598                    sb.append(getUserId());
599                    sb.append("]]></column-value></column>");
600                    sb.append(
601                            "<column><column-name>userName</column-name><column-value><![CDATA[");
602                    sb.append(getUserName());
603                    sb.append("]]></column-value></column>");
604                    sb.append(
605                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
606                    sb.append(getCreateDate());
607                    sb.append("]]></column-value></column>");
608                    sb.append(
609                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
610                    sb.append(getModifiedDate());
611                    sb.append("]]></column-value></column>");
612                    sb.append(
613                            "<column><column-name>categoryId</column-name><column-value><![CDATA[");
614                    sb.append(getCategoryId());
615                    sb.append("]]></column-value></column>");
616                    sb.append(
617                            "<column><column-name>emailAddress</column-name><column-value><![CDATA[");
618                    sb.append(getEmailAddress());
619                    sb.append("]]></column-value></column>");
620                    sb.append(
621                            "<column><column-name>inProtocol</column-name><column-value><![CDATA[");
622                    sb.append(getInProtocol());
623                    sb.append("]]></column-value></column>");
624                    sb.append(
625                            "<column><column-name>inServerName</column-name><column-value><![CDATA[");
626                    sb.append(getInServerName());
627                    sb.append("]]></column-value></column>");
628                    sb.append(
629                            "<column><column-name>inServerPort</column-name><column-value><![CDATA[");
630                    sb.append(getInServerPort());
631                    sb.append("]]></column-value></column>");
632                    sb.append(
633                            "<column><column-name>inUseSSL</column-name><column-value><![CDATA[");
634                    sb.append(getInUseSSL());
635                    sb.append("]]></column-value></column>");
636                    sb.append(
637                            "<column><column-name>inUserName</column-name><column-value><![CDATA[");
638                    sb.append(getInUserName());
639                    sb.append("]]></column-value></column>");
640                    sb.append(
641                            "<column><column-name>inPassword</column-name><column-value><![CDATA[");
642                    sb.append(getInPassword());
643                    sb.append("]]></column-value></column>");
644                    sb.append(
645                            "<column><column-name>inReadInterval</column-name><column-value><![CDATA[");
646                    sb.append(getInReadInterval());
647                    sb.append("]]></column-value></column>");
648                    sb.append(
649                            "<column><column-name>outEmailAddress</column-name><column-value><![CDATA[");
650                    sb.append(getOutEmailAddress());
651                    sb.append("]]></column-value></column>");
652                    sb.append(
653                            "<column><column-name>outCustom</column-name><column-value><![CDATA[");
654                    sb.append(getOutCustom());
655                    sb.append("]]></column-value></column>");
656                    sb.append(
657                            "<column><column-name>outServerName</column-name><column-value><![CDATA[");
658                    sb.append(getOutServerName());
659                    sb.append("]]></column-value></column>");
660                    sb.append(
661                            "<column><column-name>outServerPort</column-name><column-value><![CDATA[");
662                    sb.append(getOutServerPort());
663                    sb.append("]]></column-value></column>");
664                    sb.append(
665                            "<column><column-name>outUseSSL</column-name><column-value><![CDATA[");
666                    sb.append(getOutUseSSL());
667                    sb.append("]]></column-value></column>");
668                    sb.append(
669                            "<column><column-name>outUserName</column-name><column-value><![CDATA[");
670                    sb.append(getOutUserName());
671                    sb.append("]]></column-value></column>");
672                    sb.append(
673                            "<column><column-name>outPassword</column-name><column-value><![CDATA[");
674                    sb.append(getOutPassword());
675                    sb.append("]]></column-value></column>");
676                    sb.append(
677                            "<column><column-name>active</column-name><column-value><![CDATA[");
678                    sb.append(getActive());
679                    sb.append("]]></column-value></column>");
680    
681                    sb.append("</model>");
682    
683                    return sb.toString();
684            }
685    
686            private String _uuid;
687            private String _originalUuid;
688            private long _mailingListId;
689            private long _groupId;
690            private long _originalGroupId;
691            private boolean _setOriginalGroupId;
692            private long _companyId;
693            private long _userId;
694            private String _userUuid;
695            private String _userName;
696            private Date _createDate;
697            private Date _modifiedDate;
698            private long _categoryId;
699            private long _originalCategoryId;
700            private boolean _setOriginalCategoryId;
701            private String _emailAddress;
702            private String _inProtocol;
703            private String _inServerName;
704            private int _inServerPort;
705            private boolean _inUseSSL;
706            private String _inUserName;
707            private String _inPassword;
708            private int _inReadInterval;
709            private String _outEmailAddress;
710            private boolean _outCustom;
711            private String _outServerName;
712            private int _outServerPort;
713            private boolean _outUseSSL;
714            private String _outUserName;
715            private String _outPassword;
716            private boolean _active;
717            private transient ExpandoBridge _expandoBridge;
718    }