001    /**
002     * Copyright (c) 2000-2012 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.calendar.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.json.JSON;
020    import com.liferay.portal.kernel.util.DateUtil;
021    import com.liferay.portal.kernel.util.GetterUtil;
022    import com.liferay.portal.kernel.util.ProxyUtil;
023    import com.liferay.portal.kernel.util.StringBundler;
024    import com.liferay.portal.kernel.util.StringPool;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.impl.BaseModelImpl;
027    import com.liferay.portal.service.ServiceContext;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.calendar.model.CalEvent;
031    import com.liferay.portlet.calendar.model.CalEventModel;
032    import com.liferay.portlet.calendar.model.CalEventSoap;
033    import com.liferay.portlet.expando.model.ExpandoBridge;
034    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
035    
036    import java.io.Serializable;
037    
038    import java.sql.Types;
039    
040    import java.util.ArrayList;
041    import java.util.Date;
042    import java.util.List;
043    
044    /**
045     * The base model implementation for the CalEvent service. Represents a row in the "CalEvent" database table, with each column mapped to a property of this class.
046     *
047     * <p>
048     * This implementation and its corresponding interface {@link com.liferay.portlet.calendar.model.CalEventModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CalEventImpl}.
049     * </p>
050     *
051     * @author Brian Wing Shun Chan
052     * @see CalEventImpl
053     * @see com.liferay.portlet.calendar.model.CalEvent
054     * @see com.liferay.portlet.calendar.model.CalEventModel
055     * @generated
056     */
057    @JSON(strict = true)
058    public class CalEventModelImpl extends BaseModelImpl<CalEvent>
059            implements CalEventModel {
060            /*
061             * NOTE FOR DEVELOPERS:
062             *
063             * Never modify or reference this class directly. All methods that expect a cal event model instance should use the {@link com.liferay.portlet.calendar.model.CalEvent} interface instead.
064             */
065            public static final String TABLE_NAME = "CalEvent";
066            public static final Object[][] TABLE_COLUMNS = {
067                            { "uuid_", Types.VARCHAR },
068                            { "eventId", Types.BIGINT },
069                            { "groupId", Types.BIGINT },
070                            { "companyId", Types.BIGINT },
071                            { "userId", Types.BIGINT },
072                            { "userName", Types.VARCHAR },
073                            { "createDate", Types.TIMESTAMP },
074                            { "modifiedDate", Types.TIMESTAMP },
075                            { "title", Types.VARCHAR },
076                            { "description", Types.VARCHAR },
077                            { "location", Types.VARCHAR },
078                            { "startDate", Types.TIMESTAMP },
079                            { "endDate", Types.TIMESTAMP },
080                            { "durationHour", Types.INTEGER },
081                            { "durationMinute", Types.INTEGER },
082                            { "allDay", Types.BOOLEAN },
083                            { "timeZoneSensitive", Types.BOOLEAN },
084                            { "type_", Types.VARCHAR },
085                            { "repeating", Types.BOOLEAN },
086                            { "recurrence", Types.CLOB },
087                            { "remindBy", Types.INTEGER },
088                            { "firstReminder", Types.INTEGER },
089                            { "secondReminder", Types.INTEGER }
090                    };
091            public static final String TABLE_SQL_CREATE = "create table CalEvent (uuid_ VARCHAR(75) null,eventId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,title VARCHAR(75) null,description STRING null,location STRING null,startDate DATE null,endDate DATE null,durationHour INTEGER,durationMinute INTEGER,allDay BOOLEAN,timeZoneSensitive BOOLEAN,type_ VARCHAR(75) null,repeating BOOLEAN,recurrence TEXT null,remindBy INTEGER,firstReminder INTEGER,secondReminder INTEGER)";
092            public static final String TABLE_SQL_DROP = "drop table CalEvent";
093            public static final String ORDER_BY_JPQL = " ORDER BY calEvent.startDate ASC, calEvent.title ASC";
094            public static final String ORDER_BY_SQL = " ORDER BY CalEvent.startDate ASC, CalEvent.title ASC";
095            public static final String DATA_SOURCE = "liferayDataSource";
096            public static final String SESSION_FACTORY = "liferaySessionFactory";
097            public static final String TX_MANAGER = "liferayTransactionManager";
098            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
099                                    "value.object.entity.cache.enabled.com.liferay.portlet.calendar.model.CalEvent"),
100                            true);
101            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
102                                    "value.object.finder.cache.enabled.com.liferay.portlet.calendar.model.CalEvent"),
103                            true);
104            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
105                                    "value.object.column.bitmask.enabled.com.liferay.portlet.calendar.model.CalEvent"),
106                            true);
107            public static long COMPANYID_COLUMN_BITMASK = 1L;
108            public static long GROUPID_COLUMN_BITMASK = 2L;
109            public static long REMINDBY_COLUMN_BITMASK = 4L;
110            public static long REPEATING_COLUMN_BITMASK = 8L;
111            public static long TYPE_COLUMN_BITMASK = 16L;
112            public static long UUID_COLUMN_BITMASK = 32L;
113    
114            /**
115             * Converts the soap model instance into a normal model instance.
116             *
117             * @param soapModel the soap model instance to convert
118             * @return the normal model instance
119             */
120            public static CalEvent toModel(CalEventSoap soapModel) {
121                    CalEvent model = new CalEventImpl();
122    
123                    model.setUuid(soapModel.getUuid());
124                    model.setEventId(soapModel.getEventId());
125                    model.setGroupId(soapModel.getGroupId());
126                    model.setCompanyId(soapModel.getCompanyId());
127                    model.setUserId(soapModel.getUserId());
128                    model.setUserName(soapModel.getUserName());
129                    model.setCreateDate(soapModel.getCreateDate());
130                    model.setModifiedDate(soapModel.getModifiedDate());
131                    model.setTitle(soapModel.getTitle());
132                    model.setDescription(soapModel.getDescription());
133                    model.setLocation(soapModel.getLocation());
134                    model.setStartDate(soapModel.getStartDate());
135                    model.setEndDate(soapModel.getEndDate());
136                    model.setDurationHour(soapModel.getDurationHour());
137                    model.setDurationMinute(soapModel.getDurationMinute());
138                    model.setAllDay(soapModel.getAllDay());
139                    model.setTimeZoneSensitive(soapModel.getTimeZoneSensitive());
140                    model.setType(soapModel.getType());
141                    model.setRepeating(soapModel.getRepeating());
142                    model.setRecurrence(soapModel.getRecurrence());
143                    model.setRemindBy(soapModel.getRemindBy());
144                    model.setFirstReminder(soapModel.getFirstReminder());
145                    model.setSecondReminder(soapModel.getSecondReminder());
146    
147                    return model;
148            }
149    
150            /**
151             * Converts the soap model instances into normal model instances.
152             *
153             * @param soapModels the soap model instances to convert
154             * @return the normal model instances
155             */
156            public static List<CalEvent> toModels(CalEventSoap[] soapModels) {
157                    List<CalEvent> models = new ArrayList<CalEvent>(soapModels.length);
158    
159                    for (CalEventSoap soapModel : soapModels) {
160                            models.add(toModel(soapModel));
161                    }
162    
163                    return models;
164            }
165    
166            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
167                                    "lock.expiration.time.com.liferay.portlet.calendar.model.CalEvent"));
168    
169            public CalEventModelImpl() {
170            }
171    
172            public long getPrimaryKey() {
173                    return _eventId;
174            }
175    
176            public void setPrimaryKey(long primaryKey) {
177                    setEventId(primaryKey);
178            }
179    
180            public Serializable getPrimaryKeyObj() {
181                    return new Long(_eventId);
182            }
183    
184            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
185                    setPrimaryKey(((Long)primaryKeyObj).longValue());
186            }
187    
188            public Class<?> getModelClass() {
189                    return CalEvent.class;
190            }
191    
192            public String getModelClassName() {
193                    return CalEvent.class.getName();
194            }
195    
196            @JSON
197            public String getUuid() {
198                    if (_uuid == null) {
199                            return StringPool.BLANK;
200                    }
201                    else {
202                            return _uuid;
203                    }
204            }
205    
206            public void setUuid(String uuid) {
207                    if (_originalUuid == null) {
208                            _originalUuid = _uuid;
209                    }
210    
211                    _uuid = uuid;
212            }
213    
214            public String getOriginalUuid() {
215                    return GetterUtil.getString(_originalUuid);
216            }
217    
218            @JSON
219            public long getEventId() {
220                    return _eventId;
221            }
222    
223            public void setEventId(long eventId) {
224                    _eventId = eventId;
225            }
226    
227            @JSON
228            public long getGroupId() {
229                    return _groupId;
230            }
231    
232            public void setGroupId(long groupId) {
233                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
234    
235                    if (!_setOriginalGroupId) {
236                            _setOriginalGroupId = true;
237    
238                            _originalGroupId = _groupId;
239                    }
240    
241                    _groupId = groupId;
242            }
243    
244            public long getOriginalGroupId() {
245                    return _originalGroupId;
246            }
247    
248            @JSON
249            public long getCompanyId() {
250                    return _companyId;
251            }
252    
253            public void setCompanyId(long companyId) {
254                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
255    
256                    if (!_setOriginalCompanyId) {
257                            _setOriginalCompanyId = true;
258    
259                            _originalCompanyId = _companyId;
260                    }
261    
262                    _companyId = companyId;
263            }
264    
265            public long getOriginalCompanyId() {
266                    return _originalCompanyId;
267            }
268    
269            @JSON
270            public long getUserId() {
271                    return _userId;
272            }
273    
274            public void setUserId(long userId) {
275                    _userId = userId;
276            }
277    
278            public String getUserUuid() throws SystemException {
279                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
280            }
281    
282            public void setUserUuid(String userUuid) {
283                    _userUuid = userUuid;
284            }
285    
286            @JSON
287            public String getUserName() {
288                    if (_userName == null) {
289                            return StringPool.BLANK;
290                    }
291                    else {
292                            return _userName;
293                    }
294            }
295    
296            public void setUserName(String userName) {
297                    _userName = userName;
298            }
299    
300            @JSON
301            public Date getCreateDate() {
302                    return _createDate;
303            }
304    
305            public void setCreateDate(Date createDate) {
306                    _createDate = createDate;
307            }
308    
309            @JSON
310            public Date getModifiedDate() {
311                    return _modifiedDate;
312            }
313    
314            public void setModifiedDate(Date modifiedDate) {
315                    _modifiedDate = modifiedDate;
316            }
317    
318            @JSON
319            public String getTitle() {
320                    if (_title == null) {
321                            return StringPool.BLANK;
322                    }
323                    else {
324                            return _title;
325                    }
326            }
327    
328            public void setTitle(String title) {
329                    _columnBitmask = -1L;
330    
331                    _title = title;
332            }
333    
334            @JSON
335            public String getDescription() {
336                    if (_description == null) {
337                            return StringPool.BLANK;
338                    }
339                    else {
340                            return _description;
341                    }
342            }
343    
344            public void setDescription(String description) {
345                    _description = description;
346            }
347    
348            @JSON
349            public String getLocation() {
350                    if (_location == null) {
351                            return StringPool.BLANK;
352                    }
353                    else {
354                            return _location;
355                    }
356            }
357    
358            public void setLocation(String location) {
359                    _location = location;
360            }
361    
362            @JSON
363            public Date getStartDate() {
364                    return _startDate;
365            }
366    
367            public void setStartDate(Date startDate) {
368                    _columnBitmask = -1L;
369    
370                    _startDate = startDate;
371            }
372    
373            @JSON
374            public Date getEndDate() {
375                    return _endDate;
376            }
377    
378            public void setEndDate(Date endDate) {
379                    _endDate = endDate;
380            }
381    
382            @JSON
383            public int getDurationHour() {
384                    return _durationHour;
385            }
386    
387            public void setDurationHour(int durationHour) {
388                    _durationHour = durationHour;
389            }
390    
391            @JSON
392            public int getDurationMinute() {
393                    return _durationMinute;
394            }
395    
396            public void setDurationMinute(int durationMinute) {
397                    _durationMinute = durationMinute;
398            }
399    
400            @JSON
401            public boolean getAllDay() {
402                    return _allDay;
403            }
404    
405            public boolean isAllDay() {
406                    return _allDay;
407            }
408    
409            public void setAllDay(boolean allDay) {
410                    _allDay = allDay;
411            }
412    
413            @JSON
414            public boolean getTimeZoneSensitive() {
415                    return _timeZoneSensitive;
416            }
417    
418            public boolean isTimeZoneSensitive() {
419                    return _timeZoneSensitive;
420            }
421    
422            public void setTimeZoneSensitive(boolean timeZoneSensitive) {
423                    _timeZoneSensitive = timeZoneSensitive;
424            }
425    
426            @JSON
427            public String getType() {
428                    if (_type == null) {
429                            return StringPool.BLANK;
430                    }
431                    else {
432                            return _type;
433                    }
434            }
435    
436            public void setType(String type) {
437                    _columnBitmask |= TYPE_COLUMN_BITMASK;
438    
439                    if (_originalType == null) {
440                            _originalType = _type;
441                    }
442    
443                    _type = type;
444            }
445    
446            public String getOriginalType() {
447                    return GetterUtil.getString(_originalType);
448            }
449    
450            @JSON
451            public boolean getRepeating() {
452                    return _repeating;
453            }
454    
455            public boolean isRepeating() {
456                    return _repeating;
457            }
458    
459            public void setRepeating(boolean repeating) {
460                    _columnBitmask |= REPEATING_COLUMN_BITMASK;
461    
462                    if (!_setOriginalRepeating) {
463                            _setOriginalRepeating = true;
464    
465                            _originalRepeating = _repeating;
466                    }
467    
468                    _repeating = repeating;
469            }
470    
471            public boolean getOriginalRepeating() {
472                    return _originalRepeating;
473            }
474    
475            @JSON
476            public String getRecurrence() {
477                    if (_recurrence == null) {
478                            return StringPool.BLANK;
479                    }
480                    else {
481                            return _recurrence;
482                    }
483            }
484    
485            public void setRecurrence(String recurrence) {
486                    _recurrence = recurrence;
487            }
488    
489            @JSON
490            public int getRemindBy() {
491                    return _remindBy;
492            }
493    
494            public void setRemindBy(int remindBy) {
495                    _columnBitmask |= REMINDBY_COLUMN_BITMASK;
496    
497                    if (!_setOriginalRemindBy) {
498                            _setOriginalRemindBy = true;
499    
500                            _originalRemindBy = _remindBy;
501                    }
502    
503                    _remindBy = remindBy;
504            }
505    
506            public int getOriginalRemindBy() {
507                    return _originalRemindBy;
508            }
509    
510            @JSON
511            public int getFirstReminder() {
512                    return _firstReminder;
513            }
514    
515            public void setFirstReminder(int firstReminder) {
516                    _firstReminder = firstReminder;
517            }
518    
519            @JSON
520            public int getSecondReminder() {
521                    return _secondReminder;
522            }
523    
524            public void setSecondReminder(int secondReminder) {
525                    _secondReminder = secondReminder;
526            }
527    
528            public long getColumnBitmask() {
529                    return _columnBitmask;
530            }
531    
532            @Override
533            public CalEvent toEscapedModel() {
534                    if (_escapedModelProxy == null) {
535                            _escapedModelProxy = (CalEvent)ProxyUtil.newProxyInstance(_classLoader,
536                                            _escapedModelProxyInterfaces,
537                                            new AutoEscapeBeanHandler(this));
538                    }
539    
540                    return _escapedModelProxy;
541            }
542    
543            @Override
544            public ExpandoBridge getExpandoBridge() {
545                    if (_expandoBridge == null) {
546                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
547                                            CalEvent.class.getName(), getPrimaryKey());
548                    }
549    
550                    return _expandoBridge;
551            }
552    
553            @Override
554            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
555                    getExpandoBridge().setAttributes(serviceContext);
556            }
557    
558            @Override
559            public Object clone() {
560                    CalEventImpl calEventImpl = new CalEventImpl();
561    
562                    calEventImpl.setUuid(getUuid());
563                    calEventImpl.setEventId(getEventId());
564                    calEventImpl.setGroupId(getGroupId());
565                    calEventImpl.setCompanyId(getCompanyId());
566                    calEventImpl.setUserId(getUserId());
567                    calEventImpl.setUserName(getUserName());
568                    calEventImpl.setCreateDate(getCreateDate());
569                    calEventImpl.setModifiedDate(getModifiedDate());
570                    calEventImpl.setTitle(getTitle());
571                    calEventImpl.setDescription(getDescription());
572                    calEventImpl.setLocation(getLocation());
573                    calEventImpl.setStartDate(getStartDate());
574                    calEventImpl.setEndDate(getEndDate());
575                    calEventImpl.setDurationHour(getDurationHour());
576                    calEventImpl.setDurationMinute(getDurationMinute());
577                    calEventImpl.setAllDay(getAllDay());
578                    calEventImpl.setTimeZoneSensitive(getTimeZoneSensitive());
579                    calEventImpl.setType(getType());
580                    calEventImpl.setRepeating(getRepeating());
581                    calEventImpl.setRecurrence(getRecurrence());
582                    calEventImpl.setRemindBy(getRemindBy());
583                    calEventImpl.setFirstReminder(getFirstReminder());
584                    calEventImpl.setSecondReminder(getSecondReminder());
585    
586                    calEventImpl.resetOriginalValues();
587    
588                    return calEventImpl;
589            }
590    
591            public int compareTo(CalEvent calEvent) {
592                    int value = 0;
593    
594                    value = DateUtil.compareTo(getStartDate(), calEvent.getStartDate());
595    
596                    if (value != 0) {
597                            return value;
598                    }
599    
600                    value = getTitle().toLowerCase()
601                                            .compareTo(calEvent.getTitle().toLowerCase());
602    
603                    if (value != 0) {
604                            return value;
605                    }
606    
607                    return 0;
608            }
609    
610            @Override
611            public boolean equals(Object obj) {
612                    if (obj == null) {
613                            return false;
614                    }
615    
616                    CalEvent calEvent = null;
617    
618                    try {
619                            calEvent = (CalEvent)obj;
620                    }
621                    catch (ClassCastException cce) {
622                            return false;
623                    }
624    
625                    long primaryKey = calEvent.getPrimaryKey();
626    
627                    if (getPrimaryKey() == primaryKey) {
628                            return true;
629                    }
630                    else {
631                            return false;
632                    }
633            }
634    
635            @Override
636            public int hashCode() {
637                    return (int)getPrimaryKey();
638            }
639    
640            @Override
641            public void resetOriginalValues() {
642                    CalEventModelImpl calEventModelImpl = this;
643    
644                    calEventModelImpl._originalUuid = calEventModelImpl._uuid;
645    
646                    calEventModelImpl._originalGroupId = calEventModelImpl._groupId;
647    
648                    calEventModelImpl._setOriginalGroupId = false;
649    
650                    calEventModelImpl._originalCompanyId = calEventModelImpl._companyId;
651    
652                    calEventModelImpl._setOriginalCompanyId = false;
653    
654                    calEventModelImpl._originalType = calEventModelImpl._type;
655    
656                    calEventModelImpl._originalRepeating = calEventModelImpl._repeating;
657    
658                    calEventModelImpl._setOriginalRepeating = false;
659    
660                    calEventModelImpl._originalRemindBy = calEventModelImpl._remindBy;
661    
662                    calEventModelImpl._setOriginalRemindBy = false;
663    
664                    calEventModelImpl._columnBitmask = 0;
665            }
666    
667            @Override
668            public CacheModel<CalEvent> toCacheModel() {
669                    CalEventCacheModel calEventCacheModel = new CalEventCacheModel();
670    
671                    calEventCacheModel.uuid = getUuid();
672    
673                    String uuid = calEventCacheModel.uuid;
674    
675                    if ((uuid != null) && (uuid.length() == 0)) {
676                            calEventCacheModel.uuid = null;
677                    }
678    
679                    calEventCacheModel.eventId = getEventId();
680    
681                    calEventCacheModel.groupId = getGroupId();
682    
683                    calEventCacheModel.companyId = getCompanyId();
684    
685                    calEventCacheModel.userId = getUserId();
686    
687                    calEventCacheModel.userName = getUserName();
688    
689                    String userName = calEventCacheModel.userName;
690    
691                    if ((userName != null) && (userName.length() == 0)) {
692                            calEventCacheModel.userName = null;
693                    }
694    
695                    Date createDate = getCreateDate();
696    
697                    if (createDate != null) {
698                            calEventCacheModel.createDate = createDate.getTime();
699                    }
700                    else {
701                            calEventCacheModel.createDate = Long.MIN_VALUE;
702                    }
703    
704                    Date modifiedDate = getModifiedDate();
705    
706                    if (modifiedDate != null) {
707                            calEventCacheModel.modifiedDate = modifiedDate.getTime();
708                    }
709                    else {
710                            calEventCacheModel.modifiedDate = Long.MIN_VALUE;
711                    }
712    
713                    calEventCacheModel.title = getTitle();
714    
715                    String title = calEventCacheModel.title;
716    
717                    if ((title != null) && (title.length() == 0)) {
718                            calEventCacheModel.title = null;
719                    }
720    
721                    calEventCacheModel.description = getDescription();
722    
723                    String description = calEventCacheModel.description;
724    
725                    if ((description != null) && (description.length() == 0)) {
726                            calEventCacheModel.description = null;
727                    }
728    
729                    calEventCacheModel.location = getLocation();
730    
731                    String location = calEventCacheModel.location;
732    
733                    if ((location != null) && (location.length() == 0)) {
734                            calEventCacheModel.location = null;
735                    }
736    
737                    Date startDate = getStartDate();
738    
739                    if (startDate != null) {
740                            calEventCacheModel.startDate = startDate.getTime();
741                    }
742                    else {
743                            calEventCacheModel.startDate = Long.MIN_VALUE;
744                    }
745    
746                    Date endDate = getEndDate();
747    
748                    if (endDate != null) {
749                            calEventCacheModel.endDate = endDate.getTime();
750                    }
751                    else {
752                            calEventCacheModel.endDate = Long.MIN_VALUE;
753                    }
754    
755                    calEventCacheModel.durationHour = getDurationHour();
756    
757                    calEventCacheModel.durationMinute = getDurationMinute();
758    
759                    calEventCacheModel.allDay = getAllDay();
760    
761                    calEventCacheModel.timeZoneSensitive = getTimeZoneSensitive();
762    
763                    calEventCacheModel.type = getType();
764    
765                    String type = calEventCacheModel.type;
766    
767                    if ((type != null) && (type.length() == 0)) {
768                            calEventCacheModel.type = null;
769                    }
770    
771                    calEventCacheModel.repeating = getRepeating();
772    
773                    calEventCacheModel.recurrence = getRecurrence();
774    
775                    String recurrence = calEventCacheModel.recurrence;
776    
777                    if ((recurrence != null) && (recurrence.length() == 0)) {
778                            calEventCacheModel.recurrence = null;
779                    }
780    
781                    calEventCacheModel.remindBy = getRemindBy();
782    
783                    calEventCacheModel.firstReminder = getFirstReminder();
784    
785                    calEventCacheModel.secondReminder = getSecondReminder();
786    
787                    return calEventCacheModel;
788            }
789    
790            @Override
791            public String toString() {
792                    StringBundler sb = new StringBundler(47);
793    
794                    sb.append("{uuid=");
795                    sb.append(getUuid());
796                    sb.append(", eventId=");
797                    sb.append(getEventId());
798                    sb.append(", groupId=");
799                    sb.append(getGroupId());
800                    sb.append(", companyId=");
801                    sb.append(getCompanyId());
802                    sb.append(", userId=");
803                    sb.append(getUserId());
804                    sb.append(", userName=");
805                    sb.append(getUserName());
806                    sb.append(", createDate=");
807                    sb.append(getCreateDate());
808                    sb.append(", modifiedDate=");
809                    sb.append(getModifiedDate());
810                    sb.append(", title=");
811                    sb.append(getTitle());
812                    sb.append(", description=");
813                    sb.append(getDescription());
814                    sb.append(", location=");
815                    sb.append(getLocation());
816                    sb.append(", startDate=");
817                    sb.append(getStartDate());
818                    sb.append(", endDate=");
819                    sb.append(getEndDate());
820                    sb.append(", durationHour=");
821                    sb.append(getDurationHour());
822                    sb.append(", durationMinute=");
823                    sb.append(getDurationMinute());
824                    sb.append(", allDay=");
825                    sb.append(getAllDay());
826                    sb.append(", timeZoneSensitive=");
827                    sb.append(getTimeZoneSensitive());
828                    sb.append(", type=");
829                    sb.append(getType());
830                    sb.append(", repeating=");
831                    sb.append(getRepeating());
832                    sb.append(", recurrence=");
833                    sb.append(getRecurrence());
834                    sb.append(", remindBy=");
835                    sb.append(getRemindBy());
836                    sb.append(", firstReminder=");
837                    sb.append(getFirstReminder());
838                    sb.append(", secondReminder=");
839                    sb.append(getSecondReminder());
840                    sb.append("}");
841    
842                    return sb.toString();
843            }
844    
845            public String toXmlString() {
846                    StringBundler sb = new StringBundler(73);
847    
848                    sb.append("<model><model-name>");
849                    sb.append("com.liferay.portlet.calendar.model.CalEvent");
850                    sb.append("</model-name>");
851    
852                    sb.append(
853                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
854                    sb.append(getUuid());
855                    sb.append("]]></column-value></column>");
856                    sb.append(
857                            "<column><column-name>eventId</column-name><column-value><![CDATA[");
858                    sb.append(getEventId());
859                    sb.append("]]></column-value></column>");
860                    sb.append(
861                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
862                    sb.append(getGroupId());
863                    sb.append("]]></column-value></column>");
864                    sb.append(
865                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
866                    sb.append(getCompanyId());
867                    sb.append("]]></column-value></column>");
868                    sb.append(
869                            "<column><column-name>userId</column-name><column-value><![CDATA[");
870                    sb.append(getUserId());
871                    sb.append("]]></column-value></column>");
872                    sb.append(
873                            "<column><column-name>userName</column-name><column-value><![CDATA[");
874                    sb.append(getUserName());
875                    sb.append("]]></column-value></column>");
876                    sb.append(
877                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
878                    sb.append(getCreateDate());
879                    sb.append("]]></column-value></column>");
880                    sb.append(
881                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
882                    sb.append(getModifiedDate());
883                    sb.append("]]></column-value></column>");
884                    sb.append(
885                            "<column><column-name>title</column-name><column-value><![CDATA[");
886                    sb.append(getTitle());
887                    sb.append("]]></column-value></column>");
888                    sb.append(
889                            "<column><column-name>description</column-name><column-value><![CDATA[");
890                    sb.append(getDescription());
891                    sb.append("]]></column-value></column>");
892                    sb.append(
893                            "<column><column-name>location</column-name><column-value><![CDATA[");
894                    sb.append(getLocation());
895                    sb.append("]]></column-value></column>");
896                    sb.append(
897                            "<column><column-name>startDate</column-name><column-value><![CDATA[");
898                    sb.append(getStartDate());
899                    sb.append("]]></column-value></column>");
900                    sb.append(
901                            "<column><column-name>endDate</column-name><column-value><![CDATA[");
902                    sb.append(getEndDate());
903                    sb.append("]]></column-value></column>");
904                    sb.append(
905                            "<column><column-name>durationHour</column-name><column-value><![CDATA[");
906                    sb.append(getDurationHour());
907                    sb.append("]]></column-value></column>");
908                    sb.append(
909                            "<column><column-name>durationMinute</column-name><column-value><![CDATA[");
910                    sb.append(getDurationMinute());
911                    sb.append("]]></column-value></column>");
912                    sb.append(
913                            "<column><column-name>allDay</column-name><column-value><![CDATA[");
914                    sb.append(getAllDay());
915                    sb.append("]]></column-value></column>");
916                    sb.append(
917                            "<column><column-name>timeZoneSensitive</column-name><column-value><![CDATA[");
918                    sb.append(getTimeZoneSensitive());
919                    sb.append("]]></column-value></column>");
920                    sb.append(
921                            "<column><column-name>type</column-name><column-value><![CDATA[");
922                    sb.append(getType());
923                    sb.append("]]></column-value></column>");
924                    sb.append(
925                            "<column><column-name>repeating</column-name><column-value><![CDATA[");
926                    sb.append(getRepeating());
927                    sb.append("]]></column-value></column>");
928                    sb.append(
929                            "<column><column-name>recurrence</column-name><column-value><![CDATA[");
930                    sb.append(getRecurrence());
931                    sb.append("]]></column-value></column>");
932                    sb.append(
933                            "<column><column-name>remindBy</column-name><column-value><![CDATA[");
934                    sb.append(getRemindBy());
935                    sb.append("]]></column-value></column>");
936                    sb.append(
937                            "<column><column-name>firstReminder</column-name><column-value><![CDATA[");
938                    sb.append(getFirstReminder());
939                    sb.append("]]></column-value></column>");
940                    sb.append(
941                            "<column><column-name>secondReminder</column-name><column-value><![CDATA[");
942                    sb.append(getSecondReminder());
943                    sb.append("]]></column-value></column>");
944    
945                    sb.append("</model>");
946    
947                    return sb.toString();
948            }
949    
950            private static ClassLoader _classLoader = CalEvent.class.getClassLoader();
951            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
952                            CalEvent.class
953                    };
954            private String _uuid;
955            private String _originalUuid;
956            private long _eventId;
957            private long _groupId;
958            private long _originalGroupId;
959            private boolean _setOriginalGroupId;
960            private long _companyId;
961            private long _originalCompanyId;
962            private boolean _setOriginalCompanyId;
963            private long _userId;
964            private String _userUuid;
965            private String _userName;
966            private Date _createDate;
967            private Date _modifiedDate;
968            private String _title;
969            private String _description;
970            private String _location;
971            private Date _startDate;
972            private Date _endDate;
973            private int _durationHour;
974            private int _durationMinute;
975            private boolean _allDay;
976            private boolean _timeZoneSensitive;
977            private String _type;
978            private String _originalType;
979            private boolean _repeating;
980            private boolean _originalRepeating;
981            private boolean _setOriginalRepeating;
982            private String _recurrence;
983            private int _remindBy;
984            private int _originalRemindBy;
985            private boolean _setOriginalRemindBy;
986            private int _firstReminder;
987            private int _secondReminder;
988            private transient ExpandoBridge _expandoBridge;
989            private long _columnBitmask;
990            private CalEvent _escapedModelProxy;
991    }