1
19
20 package com.liferay.portlet.messageboards.model.impl;
21
22 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
23 import com.liferay.portal.kernel.util.GetterUtil;
24 import com.liferay.portal.kernel.util.HtmlUtil;
25 import com.liferay.portal.model.impl.BaseModelImpl;
26
27 import com.liferay.portlet.expando.model.ExpandoBridge;
28 import com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl;
29 import com.liferay.portlet.messageboards.model.MBMailingList;
30 import com.liferay.portlet.messageboards.model.MBMailingListSoap;
31
32 import java.io.Serializable;
33
34 import java.lang.reflect.Proxy;
35
36 import java.sql.Types;
37
38 import java.util.ArrayList;
39 import java.util.Date;
40 import java.util.List;
41
42
62 public class MBMailingListModelImpl extends BaseModelImpl<MBMailingList> {
63 public static final String TABLE_NAME = "MBMailingList";
64 public static final Object[][] TABLE_COLUMNS = {
65 { "uuid_", new Integer(Types.VARCHAR) },
66
67
68 { "mailingListId", new Integer(Types.BIGINT) },
69
70
71 { "groupId", new Integer(Types.BIGINT) },
72
73
74 { "companyId", new Integer(Types.BIGINT) },
75
76
77 { "userId", new Integer(Types.BIGINT) },
78
79
80 { "userName", new Integer(Types.VARCHAR) },
81
82
83 { "createDate", new Integer(Types.TIMESTAMP) },
84
85
86 { "modifiedDate", new Integer(Types.TIMESTAMP) },
87
88
89 { "categoryId", new Integer(Types.BIGINT) },
90
91
92 { "emailAddress", new Integer(Types.VARCHAR) },
93
94
95 { "inProtocol", new Integer(Types.VARCHAR) },
96
97
98 { "inServerName", new Integer(Types.VARCHAR) },
99
100
101 { "inServerPort", new Integer(Types.INTEGER) },
102
103
104 { "inUseSSL", new Integer(Types.BOOLEAN) },
105
106
107 { "inUserName", new Integer(Types.VARCHAR) },
108
109
110 { "inPassword", new Integer(Types.VARCHAR) },
111
112
113 { "inReadInterval", new Integer(Types.INTEGER) },
114
115
116 { "outEmailAddress", new Integer(Types.VARCHAR) },
117
118
119 { "outCustom", new Integer(Types.BOOLEAN) },
120
121
122 { "outServerName", new Integer(Types.VARCHAR) },
123
124
125 { "outServerPort", new Integer(Types.INTEGER) },
126
127
128 { "outUseSSL", new Integer(Types.BOOLEAN) },
129
130
131 { "outUserName", new Integer(Types.VARCHAR) },
132
133
134 { "outPassword", new Integer(Types.VARCHAR) },
135
136
137 { "active_", new Integer(Types.BOOLEAN) }
138 };
139 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)";
140 public static final String TABLE_SQL_DROP = "drop table MBMailingList";
141 public static final String DATA_SOURCE = "liferayDataSource";
142 public static final String SESSION_FACTORY = "liferaySessionFactory";
143 public static final String TX_MANAGER = "liferayTransactionManager";
144 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
145 "value.object.entity.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
146 true);
147 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
148 "value.object.finder.cache.enabled.com.liferay.portlet.messageboards.model.MBMailingList"),
149 true);
150
151 public static MBMailingList toModel(MBMailingListSoap soapModel) {
152 MBMailingList model = new MBMailingListImpl();
153
154 model.setUuid(soapModel.getUuid());
155 model.setMailingListId(soapModel.getMailingListId());
156 model.setGroupId(soapModel.getGroupId());
157 model.setCompanyId(soapModel.getCompanyId());
158 model.setUserId(soapModel.getUserId());
159 model.setUserName(soapModel.getUserName());
160 model.setCreateDate(soapModel.getCreateDate());
161 model.setModifiedDate(soapModel.getModifiedDate());
162 model.setCategoryId(soapModel.getCategoryId());
163 model.setEmailAddress(soapModel.getEmailAddress());
164 model.setInProtocol(soapModel.getInProtocol());
165 model.setInServerName(soapModel.getInServerName());
166 model.setInServerPort(soapModel.getInServerPort());
167 model.setInUseSSL(soapModel.getInUseSSL());
168 model.setInUserName(soapModel.getInUserName());
169 model.setInPassword(soapModel.getInPassword());
170 model.setInReadInterval(soapModel.getInReadInterval());
171 model.setOutEmailAddress(soapModel.getOutEmailAddress());
172 model.setOutCustom(soapModel.getOutCustom());
173 model.setOutServerName(soapModel.getOutServerName());
174 model.setOutServerPort(soapModel.getOutServerPort());
175 model.setOutUseSSL(soapModel.getOutUseSSL());
176 model.setOutUserName(soapModel.getOutUserName());
177 model.setOutPassword(soapModel.getOutPassword());
178 model.setActive(soapModel.getActive());
179
180 return model;
181 }
182
183 public static List<MBMailingList> toModels(MBMailingListSoap[] soapModels) {
184 List<MBMailingList> models = new ArrayList<MBMailingList>(soapModels.length);
185
186 for (MBMailingListSoap soapModel : soapModels) {
187 models.add(toModel(soapModel));
188 }
189
190 return models;
191 }
192
193 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
194 "lock.expiration.time.com.liferay.portlet.messageboards.model.MBMailingList"));
195
196 public MBMailingListModelImpl() {
197 }
198
199 public long getPrimaryKey() {
200 return _mailingListId;
201 }
202
203 public void setPrimaryKey(long pk) {
204 setMailingListId(pk);
205 }
206
207 public Serializable getPrimaryKeyObj() {
208 return new Long(_mailingListId);
209 }
210
211 public String getUuid() {
212 return GetterUtil.getString(_uuid);
213 }
214
215 public void setUuid(String uuid) {
216 _uuid = uuid;
217
218 if (_originalUuid == null) {
219 _originalUuid = uuid;
220 }
221 }
222
223 public String getOriginalUuid() {
224 return GetterUtil.getString(_originalUuid);
225 }
226
227 public long getMailingListId() {
228 return _mailingListId;
229 }
230
231 public void setMailingListId(long mailingListId) {
232 _mailingListId = mailingListId;
233 }
234
235 public long getGroupId() {
236 return _groupId;
237 }
238
239 public void setGroupId(long groupId) {
240 _groupId = groupId;
241
242 if (!_setOriginalGroupId) {
243 _setOriginalGroupId = true;
244
245 _originalGroupId = groupId;
246 }
247 }
248
249 public long getOriginalGroupId() {
250 return _originalGroupId;
251 }
252
253 public long getCompanyId() {
254 return _companyId;
255 }
256
257 public void setCompanyId(long companyId) {
258 _companyId = companyId;
259 }
260
261 public long getUserId() {
262 return _userId;
263 }
264
265 public void setUserId(long userId) {
266 _userId = userId;
267 }
268
269 public String getUserName() {
270 return GetterUtil.getString(_userName);
271 }
272
273 public void setUserName(String userName) {
274 _userName = userName;
275 }
276
277 public Date getCreateDate() {
278 return _createDate;
279 }
280
281 public void setCreateDate(Date createDate) {
282 _createDate = createDate;
283 }
284
285 public Date getModifiedDate() {
286 return _modifiedDate;
287 }
288
289 public void setModifiedDate(Date modifiedDate) {
290 _modifiedDate = modifiedDate;
291 }
292
293 public long getCategoryId() {
294 return _categoryId;
295 }
296
297 public void setCategoryId(long categoryId) {
298 _categoryId = categoryId;
299
300 if (!_setOriginalCategoryId) {
301 _setOriginalCategoryId = true;
302
303 _originalCategoryId = categoryId;
304 }
305 }
306
307 public long getOriginalCategoryId() {
308 return _originalCategoryId;
309 }
310
311 public String getEmailAddress() {
312 return GetterUtil.getString(_emailAddress);
313 }
314
315 public void setEmailAddress(String emailAddress) {
316 _emailAddress = emailAddress;
317 }
318
319 public String getInProtocol() {
320 return GetterUtil.getString(_inProtocol);
321 }
322
323 public void setInProtocol(String inProtocol) {
324 _inProtocol = inProtocol;
325 }
326
327 public String getInServerName() {
328 return GetterUtil.getString(_inServerName);
329 }
330
331 public void setInServerName(String inServerName) {
332 _inServerName = inServerName;
333 }
334
335 public int getInServerPort() {
336 return _inServerPort;
337 }
338
339 public void setInServerPort(int inServerPort) {
340 _inServerPort = inServerPort;
341 }
342
343 public boolean getInUseSSL() {
344 return _inUseSSL;
345 }
346
347 public boolean isInUseSSL() {
348 return _inUseSSL;
349 }
350
351 public void setInUseSSL(boolean inUseSSL) {
352 _inUseSSL = inUseSSL;
353 }
354
355 public String getInUserName() {
356 return GetterUtil.getString(_inUserName);
357 }
358
359 public void setInUserName(String inUserName) {
360 _inUserName = inUserName;
361 }
362
363 public String getInPassword() {
364 return GetterUtil.getString(_inPassword);
365 }
366
367 public void setInPassword(String inPassword) {
368 _inPassword = inPassword;
369 }
370
371 public int getInReadInterval() {
372 return _inReadInterval;
373 }
374
375 public void setInReadInterval(int inReadInterval) {
376 _inReadInterval = inReadInterval;
377 }
378
379 public String getOutEmailAddress() {
380 return GetterUtil.getString(_outEmailAddress);
381 }
382
383 public void setOutEmailAddress(String outEmailAddress) {
384 _outEmailAddress = outEmailAddress;
385 }
386
387 public boolean getOutCustom() {
388 return _outCustom;
389 }
390
391 public boolean isOutCustom() {
392 return _outCustom;
393 }
394
395 public void setOutCustom(boolean outCustom) {
396 _outCustom = outCustom;
397 }
398
399 public String getOutServerName() {
400 return GetterUtil.getString(_outServerName);
401 }
402
403 public void setOutServerName(String outServerName) {
404 _outServerName = outServerName;
405 }
406
407 public int getOutServerPort() {
408 return _outServerPort;
409 }
410
411 public void setOutServerPort(int outServerPort) {
412 _outServerPort = outServerPort;
413 }
414
415 public boolean getOutUseSSL() {
416 return _outUseSSL;
417 }
418
419 public boolean isOutUseSSL() {
420 return _outUseSSL;
421 }
422
423 public void setOutUseSSL(boolean outUseSSL) {
424 _outUseSSL = outUseSSL;
425 }
426
427 public String getOutUserName() {
428 return GetterUtil.getString(_outUserName);
429 }
430
431 public void setOutUserName(String outUserName) {
432 _outUserName = outUserName;
433 }
434
435 public String getOutPassword() {
436 return GetterUtil.getString(_outPassword);
437 }
438
439 public void setOutPassword(String outPassword) {
440 _outPassword = outPassword;
441 }
442
443 public boolean getActive() {
444 return _active;
445 }
446
447 public boolean isActive() {
448 return _active;
449 }
450
451 public void setActive(boolean active) {
452 _active = active;
453 }
454
455 public MBMailingList toEscapedModel() {
456 if (isEscapedModel()) {
457 return (MBMailingList)this;
458 }
459 else {
460 MBMailingList model = new MBMailingListImpl();
461
462 model.setNew(isNew());
463 model.setEscapedModel(true);
464
465 model.setUuid(HtmlUtil.escape(getUuid()));
466 model.setMailingListId(getMailingListId());
467 model.setGroupId(getGroupId());
468 model.setCompanyId(getCompanyId());
469 model.setUserId(getUserId());
470 model.setUserName(HtmlUtil.escape(getUserName()));
471 model.setCreateDate(getCreateDate());
472 model.setModifiedDate(getModifiedDate());
473 model.setCategoryId(getCategoryId());
474 model.setEmailAddress(HtmlUtil.escape(getEmailAddress()));
475 model.setInProtocol(HtmlUtil.escape(getInProtocol()));
476 model.setInServerName(HtmlUtil.escape(getInServerName()));
477 model.setInServerPort(getInServerPort());
478 model.setInUseSSL(getInUseSSL());
479 model.setInUserName(HtmlUtil.escape(getInUserName()));
480 model.setInPassword(HtmlUtil.escape(getInPassword()));
481 model.setInReadInterval(getInReadInterval());
482 model.setOutEmailAddress(HtmlUtil.escape(getOutEmailAddress()));
483 model.setOutCustom(getOutCustom());
484 model.setOutServerName(HtmlUtil.escape(getOutServerName()));
485 model.setOutServerPort(getOutServerPort());
486 model.setOutUseSSL(getOutUseSSL());
487 model.setOutUserName(HtmlUtil.escape(getOutUserName()));
488 model.setOutPassword(HtmlUtil.escape(getOutPassword()));
489 model.setActive(getActive());
490
491 model = (MBMailingList)Proxy.newProxyInstance(MBMailingList.class.getClassLoader(),
492 new Class[] { MBMailingList.class },
493 new ReadOnlyBeanHandler(model));
494
495 return model;
496 }
497 }
498
499 public ExpandoBridge getExpandoBridge() {
500 if (_expandoBridge == null) {
501 _expandoBridge = new ExpandoBridgeImpl(MBMailingList.class.getName(),
502 getPrimaryKey());
503 }
504
505 return _expandoBridge;
506 }
507
508 public Object clone() {
509 MBMailingListImpl clone = new MBMailingListImpl();
510
511 clone.setUuid(getUuid());
512 clone.setMailingListId(getMailingListId());
513 clone.setGroupId(getGroupId());
514 clone.setCompanyId(getCompanyId());
515 clone.setUserId(getUserId());
516 clone.setUserName(getUserName());
517 clone.setCreateDate(getCreateDate());
518 clone.setModifiedDate(getModifiedDate());
519 clone.setCategoryId(getCategoryId());
520 clone.setEmailAddress(getEmailAddress());
521 clone.setInProtocol(getInProtocol());
522 clone.setInServerName(getInServerName());
523 clone.setInServerPort(getInServerPort());
524 clone.setInUseSSL(getInUseSSL());
525 clone.setInUserName(getInUserName());
526 clone.setInPassword(getInPassword());
527 clone.setInReadInterval(getInReadInterval());
528 clone.setOutEmailAddress(getOutEmailAddress());
529 clone.setOutCustom(getOutCustom());
530 clone.setOutServerName(getOutServerName());
531 clone.setOutServerPort(getOutServerPort());
532 clone.setOutUseSSL(getOutUseSSL());
533 clone.setOutUserName(getOutUserName());
534 clone.setOutPassword(getOutPassword());
535 clone.setActive(getActive());
536
537 return clone;
538 }
539
540 public int compareTo(MBMailingList mbMailingList) {
541 long pk = mbMailingList.getPrimaryKey();
542
543 if (getPrimaryKey() < pk) {
544 return -1;
545 }
546 else if (getPrimaryKey() > pk) {
547 return 1;
548 }
549 else {
550 return 0;
551 }
552 }
553
554 public boolean equals(Object obj) {
555 if (obj == null) {
556 return false;
557 }
558
559 MBMailingList mbMailingList = null;
560
561 try {
562 mbMailingList = (MBMailingList)obj;
563 }
564 catch (ClassCastException cce) {
565 return false;
566 }
567
568 long pk = mbMailingList.getPrimaryKey();
569
570 if (getPrimaryKey() == pk) {
571 return true;
572 }
573 else {
574 return false;
575 }
576 }
577
578 public int hashCode() {
579 return (int)getPrimaryKey();
580 }
581
582 public String toString() {
583 StringBuilder sb = new StringBuilder();
584
585 sb.append("{uuid=");
586 sb.append(getUuid());
587 sb.append(", mailingListId=");
588 sb.append(getMailingListId());
589 sb.append(", groupId=");
590 sb.append(getGroupId());
591 sb.append(", companyId=");
592 sb.append(getCompanyId());
593 sb.append(", userId=");
594 sb.append(getUserId());
595 sb.append(", userName=");
596 sb.append(getUserName());
597 sb.append(", createDate=");
598 sb.append(getCreateDate());
599 sb.append(", modifiedDate=");
600 sb.append(getModifiedDate());
601 sb.append(", categoryId=");
602 sb.append(getCategoryId());
603 sb.append(", emailAddress=");
604 sb.append(getEmailAddress());
605 sb.append(", inProtocol=");
606 sb.append(getInProtocol());
607 sb.append(", inServerName=");
608 sb.append(getInServerName());
609 sb.append(", inServerPort=");
610 sb.append(getInServerPort());
611 sb.append(", inUseSSL=");
612 sb.append(getInUseSSL());
613 sb.append(", inUserName=");
614 sb.append(getInUserName());
615 sb.append(", inPassword=");
616 sb.append(getInPassword());
617 sb.append(", inReadInterval=");
618 sb.append(getInReadInterval());
619 sb.append(", outEmailAddress=");
620 sb.append(getOutEmailAddress());
621 sb.append(", outCustom=");
622 sb.append(getOutCustom());
623 sb.append(", outServerName=");
624 sb.append(getOutServerName());
625 sb.append(", outServerPort=");
626 sb.append(getOutServerPort());
627 sb.append(", outUseSSL=");
628 sb.append(getOutUseSSL());
629 sb.append(", outUserName=");
630 sb.append(getOutUserName());
631 sb.append(", outPassword=");
632 sb.append(getOutPassword());
633 sb.append(", active=");
634 sb.append(getActive());
635 sb.append("}");
636
637 return sb.toString();
638 }
639
640 public String toXmlString() {
641 StringBuilder sb = new StringBuilder();
642
643 sb.append("<model><model-name>");
644 sb.append("com.liferay.portlet.messageboards.model.MBMailingList");
645 sb.append("</model-name>");
646
647 sb.append(
648 "<column><column-name>uuid</column-name><column-value><![CDATA[");
649 sb.append(getUuid());
650 sb.append("]]></column-value></column>");
651 sb.append(
652 "<column><column-name>mailingListId</column-name><column-value><![CDATA[");
653 sb.append(getMailingListId());
654 sb.append("]]></column-value></column>");
655 sb.append(
656 "<column><column-name>groupId</column-name><column-value><![CDATA[");
657 sb.append(getGroupId());
658 sb.append("]]></column-value></column>");
659 sb.append(
660 "<column><column-name>companyId</column-name><column-value><![CDATA[");
661 sb.append(getCompanyId());
662 sb.append("]]></column-value></column>");
663 sb.append(
664 "<column><column-name>userId</column-name><column-value><![CDATA[");
665 sb.append(getUserId());
666 sb.append("]]></column-value></column>");
667 sb.append(
668 "<column><column-name>userName</column-name><column-value><![CDATA[");
669 sb.append(getUserName());
670 sb.append("]]></column-value></column>");
671 sb.append(
672 "<column><column-name>createDate</column-name><column-value><![CDATA[");
673 sb.append(getCreateDate());
674 sb.append("]]></column-value></column>");
675 sb.append(
676 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
677 sb.append(getModifiedDate());
678 sb.append("]]></column-value></column>");
679 sb.append(
680 "<column><column-name>categoryId</column-name><column-value><![CDATA[");
681 sb.append(getCategoryId());
682 sb.append("]]></column-value></column>");
683 sb.append(
684 "<column><column-name>emailAddress</column-name><column-value><![CDATA[");
685 sb.append(getEmailAddress());
686 sb.append("]]></column-value></column>");
687 sb.append(
688 "<column><column-name>inProtocol</column-name><column-value><![CDATA[");
689 sb.append(getInProtocol());
690 sb.append("]]></column-value></column>");
691 sb.append(
692 "<column><column-name>inServerName</column-name><column-value><![CDATA[");
693 sb.append(getInServerName());
694 sb.append("]]></column-value></column>");
695 sb.append(
696 "<column><column-name>inServerPort</column-name><column-value><![CDATA[");
697 sb.append(getInServerPort());
698 sb.append("]]></column-value></column>");
699 sb.append(
700 "<column><column-name>inUseSSL</column-name><column-value><![CDATA[");
701 sb.append(getInUseSSL());
702 sb.append("]]></column-value></column>");
703 sb.append(
704 "<column><column-name>inUserName</column-name><column-value><![CDATA[");
705 sb.append(getInUserName());
706 sb.append("]]></column-value></column>");
707 sb.append(
708 "<column><column-name>inPassword</column-name><column-value><![CDATA[");
709 sb.append(getInPassword());
710 sb.append("]]></column-value></column>");
711 sb.append(
712 "<column><column-name>inReadInterval</column-name><column-value><![CDATA[");
713 sb.append(getInReadInterval());
714 sb.append("]]></column-value></column>");
715 sb.append(
716 "<column><column-name>outEmailAddress</column-name><column-value><![CDATA[");
717 sb.append(getOutEmailAddress());
718 sb.append("]]></column-value></column>");
719 sb.append(
720 "<column><column-name>outCustom</column-name><column-value><![CDATA[");
721 sb.append(getOutCustom());
722 sb.append("]]></column-value></column>");
723 sb.append(
724 "<column><column-name>outServerName</column-name><column-value><![CDATA[");
725 sb.append(getOutServerName());
726 sb.append("]]></column-value></column>");
727 sb.append(
728 "<column><column-name>outServerPort</column-name><column-value><![CDATA[");
729 sb.append(getOutServerPort());
730 sb.append("]]></column-value></column>");
731 sb.append(
732 "<column><column-name>outUseSSL</column-name><column-value><![CDATA[");
733 sb.append(getOutUseSSL());
734 sb.append("]]></column-value></column>");
735 sb.append(
736 "<column><column-name>outUserName</column-name><column-value><![CDATA[");
737 sb.append(getOutUserName());
738 sb.append("]]></column-value></column>");
739 sb.append(
740 "<column><column-name>outPassword</column-name><column-value><![CDATA[");
741 sb.append(getOutPassword());
742 sb.append("]]></column-value></column>");
743 sb.append(
744 "<column><column-name>active</column-name><column-value><![CDATA[");
745 sb.append(getActive());
746 sb.append("]]></column-value></column>");
747
748 sb.append("</model>");
749
750 return sb.toString();
751 }
752
753 private String _uuid;
754 private String _originalUuid;
755 private long _mailingListId;
756 private long _groupId;
757 private long _originalGroupId;
758 private boolean _setOriginalGroupId;
759 private long _companyId;
760 private long _userId;
761 private String _userName;
762 private Date _createDate;
763 private Date _modifiedDate;
764 private long _categoryId;
765 private long _originalCategoryId;
766 private boolean _setOriginalCategoryId;
767 private String _emailAddress;
768 private String _inProtocol;
769 private String _inServerName;
770 private int _inServerPort;
771 private boolean _inUseSSL;
772 private String _inUserName;
773 private String _inPassword;
774 private int _inReadInterval;
775 private String _outEmailAddress;
776 private boolean _outCustom;
777 private String _outServerName;
778 private int _outServerPort;
779 private boolean _outUseSSL;
780 private String _outUserName;
781 private String _outPassword;
782 private boolean _active;
783 private transient ExpandoBridge _expandoBridge;
784 }