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