/** * Adds the event to the database. Also notifies the appropriate model listeners. * * @param event the event * @return the event that was added * @throws SystemException if a system exception occurred */ @Indexable(type = IndexableType.REINDEX) public Event addEvent(Event event) throws SystemException { event.setNew(true); return eventPersistence.update(event, false); }
/** * Updates the event in the database or adds it if it does not yet exist. Also notifies the * appropriate model listeners. * * @param event the event * @param merge whether to merge the event with the current session. See {@link * com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, * com.liferay.portal.model.BaseModel, boolean)} for an explanation. * @return the event that was updated * @throws SystemException if a system exception occurred */ @Indexable(type = IndexableType.REINDEX) public Event updateEvent(Event event, boolean merge) throws SystemException { event.setNew(false); return eventPersistence.update(event, merge); }