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