com.liferay.calendar.model.impl.CalendarEventModelImpl.java Source code

Java tutorial

Introduction

Here is the source code for com.liferay.calendar.model.impl.CalendarEventModelImpl.java

Source

/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.liferay.calendar.model.impl;

import com.liferay.calendar.model.CalendarEvent;
import com.liferay.calendar.model.CalendarEventModel;
import com.liferay.calendar.model.CalendarEventSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.util.DateUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.LocalizationUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import java.io.Serializable;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;

/**
 * The base model implementation for the CalendarEvent service. Represents a row in the "CalendarEvent" database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.liferay.calendar.model.CalendarEventModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CalendarEventImpl}.
 * </p>
 *
 * @author Eduardo Lundgren
 * @see CalendarEventImpl
 * @see com.liferay.calendar.model.CalendarEvent
 * @see com.liferay.calendar.model.CalendarEventModel
 * @generated
 */
@JSON(strict = true)
public class CalendarEventModelImpl extends BaseModelImpl<CalendarEvent> implements CalendarEventModel {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this class directly. All methods that expect a calendar event model instance should use the {@link com.liferay.calendar.model.CalendarEvent} interface instead.
     */
    public static final String TABLE_NAME = "CalendarEvent";
    public static final Object[][] TABLE_COLUMNS = { { "uuid_", Types.VARCHAR },
            { "calendarEventId", Types.BIGINT }, { "groupId", Types.BIGINT }, { "companyId", Types.BIGINT },
            { "userId", Types.BIGINT }, { "userName", Types.VARCHAR }, { "createDate", Types.TIMESTAMP },
            { "modifiedDate", Types.TIMESTAMP }, { "title", Types.VARCHAR }, { "description", Types.VARCHAR },
            { "location", Types.VARCHAR }, { "startDate", Types.TIMESTAMP }, { "endDate", Types.TIMESTAMP },
            { "durationHour", Types.INTEGER }, { "durationMinute", Types.INTEGER }, { "allDay", Types.BOOLEAN },
            { "recurrence", Types.VARCHAR }, { "type_", Types.VARCHAR }, { "remindBy", Types.INTEGER },
            { "firstReminder", Types.INTEGER }, { "secondReminder", Types.INTEGER } };
    public static final String TABLE_SQL_CREATE = "create table CalendarEvent (uuid_ VARCHAR(75) null,calendarEventId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,title STRING null,description STRING null,location STRING null,startDate DATE null,endDate DATE null,durationHour INTEGER,durationMinute INTEGER,allDay BOOLEAN,recurrence VARCHAR(75) null,type_ VARCHAR(75) null,remindBy INTEGER,firstReminder INTEGER,secondReminder INTEGER)";
    public static final String TABLE_SQL_DROP = "drop table CalendarEvent";
    public static final String ORDER_BY_JPQL = " ORDER BY calendarEvent.startDate ASC, calendarEvent.title ASC";
    public static final String ORDER_BY_SQL = " ORDER BY CalendarEvent.startDate ASC, CalendarEvent.title ASC";
    public static final String DATA_SOURCE = "liferayDataSource";
    public static final String SESSION_FACTORY = "liferaySessionFactory";
    public static final String TX_MANAGER = "liferayTransactionManager";
    public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps
            .get("value.object.entity.cache.enabled.com.liferay.calendar.model.CalendarEvent"), true);
    public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps
            .get("value.object.finder.cache.enabled.com.liferay.calendar.model.CalendarEvent"), true);
    public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps
            .get("value.object.column.bitmask.enabled.com.liferay.calendar.model.CalendarEvent"), true);
    public static long GROUPID_COLUMN_BITMASK = 1L;
    public static long UUID_COLUMN_BITMASK = 2L;

    /**
     * Converts the soap model instance into a normal model instance.
     *
     * @param soapModel the soap model instance to convert
     * @return the normal model instance
     */
    public static CalendarEvent toModel(CalendarEventSoap soapModel) {
        CalendarEvent model = new CalendarEventImpl();

        model.setUuid(soapModel.getUuid());
        model.setCalendarEventId(soapModel.getCalendarEventId());
        model.setGroupId(soapModel.getGroupId());
        model.setCompanyId(soapModel.getCompanyId());
        model.setUserId(soapModel.getUserId());
        model.setUserName(soapModel.getUserName());
        model.setCreateDate(soapModel.getCreateDate());
        model.setModifiedDate(soapModel.getModifiedDate());
        model.setTitle(soapModel.getTitle());
        model.setDescription(soapModel.getDescription());
        model.setLocation(soapModel.getLocation());
        model.setStartDate(soapModel.getStartDate());
        model.setEndDate(soapModel.getEndDate());
        model.setDurationHour(soapModel.getDurationHour());
        model.setDurationMinute(soapModel.getDurationMinute());
        model.setAllDay(soapModel.getAllDay());
        model.setRecurrence(soapModel.getRecurrence());
        model.setType(soapModel.getType());
        model.setRemindBy(soapModel.getRemindBy());
        model.setFirstReminder(soapModel.getFirstReminder());
        model.setSecondReminder(soapModel.getSecondReminder());

        return model;
    }

    /**
     * Converts the soap model instances into normal model instances.
     *
     * @param soapModels the soap model instances to convert
     * @return the normal model instances
     */
    public static List<CalendarEvent> toModels(CalendarEventSoap[] soapModels) {
        List<CalendarEvent> models = new ArrayList<CalendarEvent>(soapModels.length);

        for (CalendarEventSoap soapModel : soapModels) {
            models.add(toModel(soapModel));
        }

        return models;
    }

    public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps
            .get("lock.expiration.time.com.liferay.calendar.model.CalendarEvent"));

    public CalendarEventModelImpl() {
    }

    public long getPrimaryKey() {
        return _calendarEventId;
    }

    public void setPrimaryKey(long primaryKey) {
        setCalendarEventId(primaryKey);
    }

    public Serializable getPrimaryKeyObj() {
        return new Long(_calendarEventId);
    }

    public void setPrimaryKeyObj(Serializable primaryKeyObj) {
        setPrimaryKey(((Long) primaryKeyObj).longValue());
    }

    public Class<?> getModelClass() {
        return CalendarEvent.class;
    }

    public String getModelClassName() {
        return CalendarEvent.class.getName();
    }

    @JSON
    public String getUuid() {
        if (_uuid == null) {
            return StringPool.BLANK;
        } else {
            return _uuid;
        }
    }

    public void setUuid(String uuid) {
        if (_originalUuid == null) {
            _originalUuid = _uuid;
        }

        _uuid = uuid;
    }

    public String getOriginalUuid() {
        return GetterUtil.getString(_originalUuid);
    }

    @JSON
    public long getCalendarEventId() {
        return _calendarEventId;
    }

    public void setCalendarEventId(long calendarEventId) {
        _calendarEventId = calendarEventId;
    }

    @JSON
    public long getGroupId() {
        return _groupId;
    }

    public void setGroupId(long groupId) {
        _columnBitmask |= GROUPID_COLUMN_BITMASK;

        if (!_setOriginalGroupId) {
            _setOriginalGroupId = true;

            _originalGroupId = _groupId;
        }

        _groupId = groupId;
    }

    public long getOriginalGroupId() {
        return _originalGroupId;
    }

    @JSON
    public long getCompanyId() {
        return _companyId;
    }

    public void setCompanyId(long companyId) {
        _companyId = companyId;
    }

    @JSON
    public long getUserId() {
        return _userId;
    }

    public void setUserId(long userId) {
        _userId = userId;
    }

    public String getUserUuid() throws SystemException {
        return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
    }

    public void setUserUuid(String userUuid) {
        _userUuid = userUuid;
    }

    @JSON
    public String getUserName() {
        if (_userName == null) {
            return StringPool.BLANK;
        } else {
            return _userName;
        }
    }

    public void setUserName(String userName) {
        _userName = userName;
    }

    @JSON
    public Date getCreateDate() {
        return _createDate;
    }

    public void setCreateDate(Date createDate) {
        _createDate = createDate;
    }

    @JSON
    public Date getModifiedDate() {
        return _modifiedDate;
    }

    public void setModifiedDate(Date modifiedDate) {
        _modifiedDate = modifiedDate;
    }

    @JSON
    public String getTitle() {
        if (_title == null) {
            return StringPool.BLANK;
        } else {
            return _title;
        }
    }

    public String getTitle(Locale locale) {
        String languageId = LocaleUtil.toLanguageId(locale);

        return getTitle(languageId);
    }

    public String getTitle(Locale locale, boolean useDefault) {
        String languageId = LocaleUtil.toLanguageId(locale);

        return getTitle(languageId, useDefault);
    }

    public String getTitle(String languageId) {
        return LocalizationUtil.getLocalization(getTitle(), languageId);
    }

    public String getTitle(String languageId, boolean useDefault) {
        return LocalizationUtil.getLocalization(getTitle(), languageId, useDefault);
    }

    public String getTitleCurrentLanguageId() {
        return _titleCurrentLanguageId;
    }

    @JSON
    public String getTitleCurrentValue() {
        Locale locale = getLocale(_titleCurrentLanguageId);

        return getTitle(locale);
    }

    public Map<Locale, String> getTitleMap() {
        return LocalizationUtil.getLocalizationMap(getTitle());
    }

    public void setTitle(String title) {
        _columnBitmask = -1L;

        _title = title;
    }

    public void setTitle(String title, Locale locale) {
        setTitle(title, locale, LocaleUtil.getDefault());
    }

    public void setTitle(String title, Locale locale, Locale defaultLocale) {
        String languageId = LocaleUtil.toLanguageId(locale);
        String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

        if (Validator.isNotNull(title)) {
            setTitle(
                    LocalizationUtil.updateLocalization(getTitle(), "Title", title, languageId, defaultLanguageId));
        } else {
            setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title", languageId));
        }
    }

    public void setTitleCurrentLanguageId(String languageId) {
        _titleCurrentLanguageId = languageId;
    }

    public void setTitleMap(Map<Locale, String> titleMap) {
        setTitleMap(titleMap, LocaleUtil.getDefault());
    }

    public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
        if (titleMap == null) {
            return;
        }

        Locale[] locales = LanguageUtil.getAvailableLocales();

        for (Locale locale : locales) {
            String title = titleMap.get(locale);

            setTitle(title, locale, defaultLocale);
        }
    }

    @JSON
    public String getDescription() {
        if (_description == null) {
            return StringPool.BLANK;
        } else {
            return _description;
        }
    }

    public String getDescription(Locale locale) {
        String languageId = LocaleUtil.toLanguageId(locale);

        return getDescription(languageId);
    }

    public String getDescription(Locale locale, boolean useDefault) {
        String languageId = LocaleUtil.toLanguageId(locale);

        return getDescription(languageId, useDefault);
    }

    public String getDescription(String languageId) {
        return LocalizationUtil.getLocalization(getDescription(), languageId);
    }

    public String getDescription(String languageId, boolean useDefault) {
        return LocalizationUtil.getLocalization(getDescription(), languageId, useDefault);
    }

    public String getDescriptionCurrentLanguageId() {
        return _descriptionCurrentLanguageId;
    }

    @JSON
    public String getDescriptionCurrentValue() {
        Locale locale = getLocale(_descriptionCurrentLanguageId);

        return getDescription(locale);
    }

    public Map<Locale, String> getDescriptionMap() {
        return LocalizationUtil.getLocalizationMap(getDescription());
    }

    public void setDescription(String description) {
        _description = description;
    }

    public void setDescription(String description, Locale locale) {
        setDescription(description, locale, LocaleUtil.getDefault());
    }

    public void setDescription(String description, Locale locale, Locale defaultLocale) {
        String languageId = LocaleUtil.toLanguageId(locale);
        String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

        if (Validator.isNotNull(description)) {
            setDescription(LocalizationUtil.updateLocalization(getDescription(), "Description", description,
                    languageId, defaultLanguageId));
        } else {
            setDescription(LocalizationUtil.removeLocalization(getDescription(), "Description", languageId));
        }
    }

    public void setDescriptionCurrentLanguageId(String languageId) {
        _descriptionCurrentLanguageId = languageId;
    }

    public void setDescriptionMap(Map<Locale, String> descriptionMap) {
        setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
    }

    public void setDescriptionMap(Map<Locale, String> descriptionMap, Locale defaultLocale) {
        if (descriptionMap == null) {
            return;
        }

        Locale[] locales = LanguageUtil.getAvailableLocales();

        for (Locale locale : locales) {
            String description = descriptionMap.get(locale);

            setDescription(description, locale, defaultLocale);
        }
    }

    @JSON
    public String getLocation() {
        if (_location == null) {
            return StringPool.BLANK;
        } else {
            return _location;
        }
    }

    public void setLocation(String location) {
        _location = location;
    }

    @JSON
    public Date getStartDate() {
        return _startDate;
    }

    public void setStartDate(Date startDate) {
        _columnBitmask = -1L;

        _startDate = startDate;
    }

    @JSON
    public Date getEndDate() {
        return _endDate;
    }

    public void setEndDate(Date endDate) {
        _endDate = endDate;
    }

    @JSON
    public int getDurationHour() {
        return _durationHour;
    }

    public void setDurationHour(int durationHour) {
        _durationHour = durationHour;
    }

    @JSON
    public int getDurationMinute() {
        return _durationMinute;
    }

    public void setDurationMinute(int durationMinute) {
        _durationMinute = durationMinute;
    }

    @JSON
    public boolean getAllDay() {
        return _allDay;
    }

    public boolean isAllDay() {
        return _allDay;
    }

    public void setAllDay(boolean allDay) {
        _allDay = allDay;
    }

    @JSON
    public String getRecurrence() {
        if (_recurrence == null) {
            return StringPool.BLANK;
        } else {
            return _recurrence;
        }
    }

    public void setRecurrence(String recurrence) {
        _recurrence = recurrence;
    }

    @JSON
    public String getType() {
        if (_type == null) {
            return StringPool.BLANK;
        } else {
            return _type;
        }
    }

    public void setType(String type) {
        _type = type;
    }

    @JSON
    public int getRemindBy() {
        return _remindBy;
    }

    public void setRemindBy(int remindBy) {
        _remindBy = remindBy;
    }

    @JSON
    public int getFirstReminder() {
        return _firstReminder;
    }

    public void setFirstReminder(int firstReminder) {
        _firstReminder = firstReminder;
    }

    @JSON
    public int getSecondReminder() {
        return _secondReminder;
    }

    public void setSecondReminder(int secondReminder) {
        _secondReminder = secondReminder;
    }

    public long getColumnBitmask() {
        return _columnBitmask;
    }

    @Override
    public CalendarEvent toEscapedModel() {
        if (_escapedModelProxy == null) {
            _escapedModelProxy = (CalendarEvent) ProxyUtil.newProxyInstance(_classLoader,
                    _escapedModelProxyInterfaces, new AutoEscapeBeanHandler(this));
        }

        return _escapedModelProxy;
    }

    @Override
    public ExpandoBridge getExpandoBridge() {
        if (_expandoBridge == null) {
            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
                    CalendarEvent.class.getName(), getPrimaryKey());
        }

        return _expandoBridge;
    }

    @Override
    public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
        getExpandoBridge().setAttributes(serviceContext);
    }

    @Override
    public Object clone() {
        CalendarEventImpl calendarEventImpl = new CalendarEventImpl();

        calendarEventImpl.setUuid(getUuid());
        calendarEventImpl.setCalendarEventId(getCalendarEventId());
        calendarEventImpl.setGroupId(getGroupId());
        calendarEventImpl.setCompanyId(getCompanyId());
        calendarEventImpl.setUserId(getUserId());
        calendarEventImpl.setUserName(getUserName());
        calendarEventImpl.setCreateDate(getCreateDate());
        calendarEventImpl.setModifiedDate(getModifiedDate());
        calendarEventImpl.setTitle(getTitle());
        calendarEventImpl.setDescription(getDescription());
        calendarEventImpl.setLocation(getLocation());
        calendarEventImpl.setStartDate(getStartDate());
        calendarEventImpl.setEndDate(getEndDate());
        calendarEventImpl.setDurationHour(getDurationHour());
        calendarEventImpl.setDurationMinute(getDurationMinute());
        calendarEventImpl.setAllDay(getAllDay());
        calendarEventImpl.setRecurrence(getRecurrence());
        calendarEventImpl.setType(getType());
        calendarEventImpl.setRemindBy(getRemindBy());
        calendarEventImpl.setFirstReminder(getFirstReminder());
        calendarEventImpl.setSecondReminder(getSecondReminder());

        calendarEventImpl.resetOriginalValues();

        return calendarEventImpl;
    }

    public int compareTo(CalendarEvent calendarEvent) {
        int value = 0;

        value = DateUtil.compareTo(getStartDate(), calendarEvent.getStartDate());

        if (value != 0) {
            return value;
        }

        value = getTitle().toLowerCase().compareTo(calendarEvent.getTitle().toLowerCase());

        if (value != 0) {
            return value;
        }

        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        CalendarEvent calendarEvent = null;

        try {
            calendarEvent = (CalendarEvent) obj;
        } catch (ClassCastException cce) {
            return false;
        }

        long primaryKey = calendarEvent.getPrimaryKey();

        if (getPrimaryKey() == primaryKey) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return (int) getPrimaryKey();
    }

    @Override
    public void resetOriginalValues() {
        CalendarEventModelImpl calendarEventModelImpl = this;

        calendarEventModelImpl._originalUuid = calendarEventModelImpl._uuid;

        calendarEventModelImpl._originalGroupId = calendarEventModelImpl._groupId;

        calendarEventModelImpl._setOriginalGroupId = false;

        calendarEventModelImpl._columnBitmask = 0;
    }

    @Override
    public CacheModel<CalendarEvent> toCacheModel() {
        CalendarEventCacheModel calendarEventCacheModel = new CalendarEventCacheModel();

        calendarEventCacheModel.uuid = getUuid();

        String uuid = calendarEventCacheModel.uuid;

        if ((uuid != null) && (uuid.length() == 0)) {
            calendarEventCacheModel.uuid = null;
        }

        calendarEventCacheModel.calendarEventId = getCalendarEventId();

        calendarEventCacheModel.groupId = getGroupId();

        calendarEventCacheModel.companyId = getCompanyId();

        calendarEventCacheModel.userId = getUserId();

        calendarEventCacheModel.userName = getUserName();

        String userName = calendarEventCacheModel.userName;

        if ((userName != null) && (userName.length() == 0)) {
            calendarEventCacheModel.userName = null;
        }

        Date createDate = getCreateDate();

        if (createDate != null) {
            calendarEventCacheModel.createDate = createDate.getTime();
        } else {
            calendarEventCacheModel.createDate = Long.MIN_VALUE;
        }

        Date modifiedDate = getModifiedDate();

        if (modifiedDate != null) {
            calendarEventCacheModel.modifiedDate = modifiedDate.getTime();
        } else {
            calendarEventCacheModel.modifiedDate = Long.MIN_VALUE;
        }

        calendarEventCacheModel.title = getTitle();

        String title = calendarEventCacheModel.title;

        if ((title != null) && (title.length() == 0)) {
            calendarEventCacheModel.title = null;
        }

        calendarEventCacheModel.description = getDescription();

        String description = calendarEventCacheModel.description;

        if ((description != null) && (description.length() == 0)) {
            calendarEventCacheModel.description = null;
        }

        calendarEventCacheModel.location = getLocation();

        String location = calendarEventCacheModel.location;

        if ((location != null) && (location.length() == 0)) {
            calendarEventCacheModel.location = null;
        }

        Date startDate = getStartDate();

        if (startDate != null) {
            calendarEventCacheModel.startDate = startDate.getTime();
        } else {
            calendarEventCacheModel.startDate = Long.MIN_VALUE;
        }

        Date endDate = getEndDate();

        if (endDate != null) {
            calendarEventCacheModel.endDate = endDate.getTime();
        } else {
            calendarEventCacheModel.endDate = Long.MIN_VALUE;
        }

        calendarEventCacheModel.durationHour = getDurationHour();

        calendarEventCacheModel.durationMinute = getDurationMinute();

        calendarEventCacheModel.allDay = getAllDay();

        calendarEventCacheModel.recurrence = getRecurrence();

        String recurrence = calendarEventCacheModel.recurrence;

        if ((recurrence != null) && (recurrence.length() == 0)) {
            calendarEventCacheModel.recurrence = null;
        }

        calendarEventCacheModel.type = getType();

        String type = calendarEventCacheModel.type;

        if ((type != null) && (type.length() == 0)) {
            calendarEventCacheModel.type = null;
        }

        calendarEventCacheModel.remindBy = getRemindBy();

        calendarEventCacheModel.firstReminder = getFirstReminder();

        calendarEventCacheModel.secondReminder = getSecondReminder();

        return calendarEventCacheModel;
    }

    @Override
    public String toString() {
        StringBundler sb = new StringBundler(43);

        sb.append("{uuid=");
        sb.append(getUuid());
        sb.append(", calendarEventId=");
        sb.append(getCalendarEventId());
        sb.append(", groupId=");
        sb.append(getGroupId());
        sb.append(", companyId=");
        sb.append(getCompanyId());
        sb.append(", userId=");
        sb.append(getUserId());
        sb.append(", userName=");
        sb.append(getUserName());
        sb.append(", createDate=");
        sb.append(getCreateDate());
        sb.append(", modifiedDate=");
        sb.append(getModifiedDate());
        sb.append(", title=");
        sb.append(getTitle());
        sb.append(", description=");
        sb.append(getDescription());
        sb.append(", location=");
        sb.append(getLocation());
        sb.append(", startDate=");
        sb.append(getStartDate());
        sb.append(", endDate=");
        sb.append(getEndDate());
        sb.append(", durationHour=");
        sb.append(getDurationHour());
        sb.append(", durationMinute=");
        sb.append(getDurationMinute());
        sb.append(", allDay=");
        sb.append(getAllDay());
        sb.append(", recurrence=");
        sb.append(getRecurrence());
        sb.append(", type=");
        sb.append(getType());
        sb.append(", remindBy=");
        sb.append(getRemindBy());
        sb.append(", firstReminder=");
        sb.append(getFirstReminder());
        sb.append(", secondReminder=");
        sb.append(getSecondReminder());
        sb.append("}");

        return sb.toString();
    }

    public String toXmlString() {
        StringBundler sb = new StringBundler(67);

        sb.append("<model><model-name>");
        sb.append("com.liferay.calendar.model.CalendarEvent");
        sb.append("</model-name>");

        sb.append("<column><column-name>uuid</column-name><column-value><![CDATA[");
        sb.append(getUuid());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>calendarEventId</column-name><column-value><![CDATA[");
        sb.append(getCalendarEventId());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>groupId</column-name><column-value><![CDATA[");
        sb.append(getGroupId());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>companyId</column-name><column-value><![CDATA[");
        sb.append(getCompanyId());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>userId</column-name><column-value><![CDATA[");
        sb.append(getUserId());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>userName</column-name><column-value><![CDATA[");
        sb.append(getUserName());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>createDate</column-name><column-value><![CDATA[");
        sb.append(getCreateDate());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
        sb.append(getModifiedDate());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>title</column-name><column-value><![CDATA[");
        sb.append(getTitle());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>description</column-name><column-value><![CDATA[");
        sb.append(getDescription());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>location</column-name><column-value><![CDATA[");
        sb.append(getLocation());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>startDate</column-name><column-value><![CDATA[");
        sb.append(getStartDate());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>endDate</column-name><column-value><![CDATA[");
        sb.append(getEndDate());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>durationHour</column-name><column-value><![CDATA[");
        sb.append(getDurationHour());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>durationMinute</column-name><column-value><![CDATA[");
        sb.append(getDurationMinute());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>allDay</column-name><column-value><![CDATA[");
        sb.append(getAllDay());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>recurrence</column-name><column-value><![CDATA[");
        sb.append(getRecurrence());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>type</column-name><column-value><![CDATA[");
        sb.append(getType());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>remindBy</column-name><column-value><![CDATA[");
        sb.append(getRemindBy());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>firstReminder</column-name><column-value><![CDATA[");
        sb.append(getFirstReminder());
        sb.append("]]></column-value></column>");
        sb.append("<column><column-name>secondReminder</column-name><column-value><![CDATA[");
        sb.append(getSecondReminder());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }

    private static ClassLoader _classLoader = CalendarEvent.class.getClassLoader();
    private static Class<?>[] _escapedModelProxyInterfaces = new Class[] { CalendarEvent.class };
    private String _uuid;
    private String _originalUuid;
    private long _calendarEventId;
    private long _groupId;
    private long _originalGroupId;
    private boolean _setOriginalGroupId;
    private long _companyId;
    private long _userId;
    private String _userUuid;
    private String _userName;
    private Date _createDate;
    private Date _modifiedDate;
    private String _title;
    private String _titleCurrentLanguageId;
    private String _description;
    private String _descriptionCurrentLanguageId;
    private String _location;
    private Date _startDate;
    private Date _endDate;
    private int _durationHour;
    private int _durationMinute;
    private boolean _allDay;
    private String _recurrence;
    private String _type;
    private int _remindBy;
    private int _firstReminder;
    private int _secondReminder;
    private transient ExpandoBridge _expandoBridge;
    private long _columnBitmask;
    private CalendarEvent _escapedModelProxy;
}