Package org.exoplatform.agenda.dao
Class EventDAO
java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
org.exoplatform.agenda.dao.EventDAO
- All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long>
public class EventDAO
extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
Field Summary
Fields inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
modelClass -
Constructor Summary
ConstructorsConstructorDescriptionEventDAO(EventConferenceDAO eventConferenceDAO, EventAttendeeDAO eventAttendeeDAO, EventReminderDAO eventReminderDAO, EventRecurrenceDAO eventRecurrenceDAO, RemoteEventDAO remoteEventDAO, EventDateOptionDAO dateOptionDAO, EventDatePollDAO datePollDAO) -
Method Summary
Modifier and TypeMethodDescriptioncountEventDatePolls(List<Long> attendeeIds, Date fromDate) countPendingEvents(Long userIdentityId, List<Long> attendeeIds, List<Long> calenderIds, Date fromDate) longcountPendingEventsByOwnerIds(Long userIdentityId, List<Long> ownerIds, List<Long> attendeeIds, Date fromDate) create(EventEntity entity) voiddelete(EventEntity entity) voidvoiddeleteCalendarEvents(long calendarId) deleteEvent(long eventId) deleteEventAfterRead(long eventId) Deletes an event whose attendees, conferences or reminders may have been read through this persistence context.voiddeleteExceptionalOccurences(long parentRecurrentEventId) voidexecuteDeleteCalendarEventsQuery(long calendarId) getEventDatePollIds(Long userIdentityId, List<Long> attendeeIds, Date fromDate, int offset, int limit) getEventDatePollIdsByOwnerIds(Long userIdentityId, List<Long> ownerIds, List<Long> attendeeIds, Date fromDate, int offset, int limit) getEventDatePollIdsByOwnerIds(Long userIdentityId, List<Long> ownerIds, List<Long> attendeeIds, Date start, Date end) getEventIds(Date startDate, Date endDate, List<Long> ownerIds, List<Long> attendeeIds, List<org.exoplatform.agenda.constant.EventAttendeeResponse> responseTypes, List<Long> excludedCalendarIds, int limit) Retrieves the identifiers of the events matching a period and the given owner, attendee and response criteria.getEventIds(Date startDate, Date endDate, List<Long> ownerIds, List<Long> attendeeIds, List<org.exoplatform.agenda.constant.EventAttendeeResponse> responseTypes, List<Long> excludedCalendarIds, List<Long> calendarIds, int limit) Retrieves the identifiers of the events matching a period and the given owner, attendee and response criteria, plus the events of some calendars whatever those criteria say (EXO-90357).getExceptionalOccurenceIds(long parentRecurrentEventId) getExceptionalOccurenceIdsByPeriod(long parentRecurrentEventId, Date startDate, Date endDate) getExceptionalOccurenceIdsByStart(long parentRecurrentEventId, Date startDate) getParentRecurrentEventIds(Date startDate, Date endDate) getPendingEventIds(Long userIdentityId, List<Long> attendeeIds, List<Long> calenderIds, Date fromDate, int offset, int limit) getPendingEventIdsByOwnerIds(Long userIdentityId, List<Long> ownerIds, List<Long> attendeeIds, Date fromDate, int offset, int limit) getUserEventCalenderIds(Long userIdentityId) moveCalendarEvents(long fromCalendarId, long toCalendarId) Moves all events of a calendar to another calendar in a single bulk update, keeping every event row (and its attendees, reminders, conferences, recurrences and remote identifiers) untouched apart from its calendar membership.update(EventEntity entity) voidupdateAll(List<EventEntity> entities) Methods inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
count, createAll, deleteAll, find, findAll, getEntityManager, getHibernateDialect, isMSSQLDialect, isOrcaleDialect
-
Constructor Details
-
EventDAO
public EventDAO(EventConferenceDAO eventConferenceDAO, EventAttendeeDAO eventAttendeeDAO, EventReminderDAO eventReminderDAO, EventRecurrenceDAO eventRecurrenceDAO, RemoteEventDAO remoteEventDAO, EventDateOptionDAO dateOptionDAO, EventDatePollDAO datePollDAO)
-
-
Method Details
-
delete
- Specified by:
deletein interfaceorg.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long> - Overrides:
deletein classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
deleteCalendarEvents
public void deleteCalendarEvents(long calendarId) -
moveCalendarEvents
Moves all events of a calendar to another calendar in a single bulk update, keeping every event row (and its attendees, reminders, conferences, recurrences and remote identifiers) untouched apart from its calendar membership.- Parameters:
fromCalendarId- technical identifier of the calendar the events are moved away fromtoCalendarId- technical identifier of the calendar receiving the events- Returns:
Listof technical identifiers of the moved events, empty when the source calendar had no events
-
deleteEventAfterRead
Deletes an event whose attendees, conferences or reminders may have been read through this persistence context. They are deleted in bulk, which leaves such instances managed and pointing at a removed event when the context is flushed, so the pending changes are flushed and the context cleared first. The clear detaches every entity the persistence context holds, not only this event's children: a caller must not keep a managed entity across this call and rely on dirty checking or on a lazy collection of it afterwards.- Parameters:
eventId- the event to delete- Returns:
- the deleted entity, null when there was none
-
deleteEvent
-
create
- Specified by:
createin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long> - Overrides:
createin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
update
- Specified by:
updatein interfaceorg.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long> - Overrides:
updatein classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
deleteAll
public void deleteAll()- Specified by:
deleteAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long> - Overrides:
deleteAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
updateAll
- Specified by:
updateAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<EventEntity,Long> - Overrides:
updateAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventEntity,Long>
-
executeDeleteCalendarEventsQuery
public void executeDeleteCalendarEventsQuery(long calendarId) -
getEventIds
public List<Long> getEventIds(Date startDate, Date endDate, List<Long> ownerIds, List<Long> attendeeIds, List<org.exoplatform.agenda.constant.EventAttendeeResponse> responseTypes, List<Long> excludedCalendarIds, int limit) Retrieves the identifiers of the events matching a period and the given owner, attendee and response criteria.- Parameters:
startDate- beginning of the period, mandatoryendDate- end of the period,nullfor an open periodownerIds- identity identifiers of the calendar owners to keep, empty ornullto keep every ownerattendeeIds- identity identifiers to filter on attendees, empty ornullto ignore attendeesresponseTypes- attendee responses to keep, only used together withattendeeIdsexcludedCalendarIds- technical identifiers of the calendars whose events must be left out, whatever the owner criteria kept; empty ornullto exclude nothinglimit- maximum number of identifiers to return, 0 for no limit- Returns:
Listof matching event technical identifiers
-
getEventIds
public List<Long> getEventIds(Date startDate, Date endDate, List<Long> ownerIds, List<Long> attendeeIds, List<org.exoplatform.agenda.constant.EventAttendeeResponse> responseTypes, List<Long> excludedCalendarIds, List<Long> calendarIds, int limit) Retrieves the identifiers of the events matching a period and the given owner, attendee and response criteria, plus the events of some calendars whatever those criteria say (EXO-90357).One statement. The owner and attendee criteria form one conjunction, the listed calendars are or-ed with it: an event is kept when it matches the criteria, or when its calendar is listed. The attendee join becomes an outer one when calendars are listed, since an event of a shared calendar has no attendee row for the reader;
DISTINCTkeeps an event with several attendee rows once. The exclusion still applies to everything.- Parameters:
startDate- beginning of the period, mandatoryendDate- end of the period,nullfor an open periodownerIds- identity identifiers of the calendar owners to keep, empty ornullto keep every ownerattendeeIds- identity identifiers to filter on attendees, empty ornullto ignore attendeesresponseTypes- attendee responses to keep, only used together withattendeeIdsexcludedCalendarIds- technical identifiers of the calendars whose events must be left out, whatever else keeps themcalendarIds- technical identifiers of the calendars whose events are kept whatever the owner and attendee criteria say; empty ornullfor nonelimit- maximum number of identifiers to return, 0 for no limit- Returns:
Listof matching event technical identifiers
-
getUserEventCalenderIds
-
getPendingEventIds
-
countPendingEvents
-
getPendingEventIdsByOwnerIds
-
countPendingEventsByOwnerIds
-
getEventDatePollIds
-
getEventDatePollIds
-
countEventDatePolls
-
getEventDatePollIdsByOwnerIds
-
getEventDatePollIdsByOwnerIds
-
countEventDatePollsByOwnerIds
-
getParentRecurrentEventIds
-
getExceptionalOccurenceIdsByPeriod
-
getExceptionalOccurenceIdsByStart
-
getExceptionalOccurenceIds
-
deleteExceptionalOccurences
public void deleteExceptionalOccurences(long parentRecurrentEventId)
-