Class EventAttendeeDAO

java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventAttendeeEntity, Long>
org.exoplatform.agenda.dao.EventAttendeeDAO
All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<EventAttendeeEntity, Long>

public class EventAttendeeDAO extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventAttendeeEntity, Long>
  • Constructor Details

    • EventAttendeeDAO

      public EventAttendeeDAO()
  • Method Details

    • delete

      public void delete(EventAttendeeEntity entity)
      Deletes an attendee row and sends the delete at once. A decide step that replaces an answer deletes a row and inserts one with the same key in its one transaction: without the flush, the insert would reach the database first. On an identity column (MySQL) Hibernate sends the insert when the row is persisted, and on a sequence it sends a flush's inserts before its deletes.
      Specified by:
      delete in interface org.exoplatform.commons.api.persistence.GenericDAO<EventAttendeeEntity, Long>
      Overrides:
      delete in class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<EventAttendeeEntity, Long>
      Parameters:
      entity - the attendee row to delete
    • deleteCalendarAttendees

      public void deleteCalendarAttendees(long calendarId)
    • deleteEventAttendees

      public void deleteEventAttendees(long eventId)
    • getEventAttendees

      public List<EventAttendeeEntity> getEventAttendees(long eventId)
    • getEventAttendeesByResponses

      public List<EventAttendeeEntity> getEventAttendeesByResponses(long eventId, org.exoplatform.agenda.constant.EventAttendeeResponse... responses)
    • getSeatRows

      public List<Object[]> getSeatRows(long eventId, org.exoplatform.agenda.constant.EventAttendeeResponse... responses)
      Reads the rows of an event that have one of the given answers, as scalar values: no entity is loaded, so the rows a seat decision counts do not enter the persistence context it writes through.
      Parameters:
      eventId - event identifier
      responses - the answers to read
      Returns:
      per row: id, identity id, from occurrence id, until occurrence id, answer and answer date, in that order
    • getWaitingAttendees

      public List<Object[]> getWaitingAttendees(long eventId)
      Reads the waiting rows of an event in the order they are promoted: the earliest answer date first, then the lowest id. Every waiting row is written with its answer date, so none sorts on a null.
      Parameters:
      eventId - event identifier
      Returns:
      the rows as getSeatRows(long, EventAttendeeResponse...) returns them
    • getEventAttendees

      public List<EventAttendeeEntity> getEventAttendees(long eventId, long identityId)