Package com.logicaldoc.calendar
Interface EventDAO
- All Superinterfaces:
- com.logicaldoc.core.PersistentObjectDAO<Event>
- All Known Implementing Classes:
- HibernateEventDAO
DAO for events handling.
- Since:
- 6.7
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionintcleanOldEvents(int ttl) This method deletes all the events oldest than the given days from now.createOccurrences(Event master, Date start, Date end) This will create all the occurrences of a recurrent master event in a given time range.
 Attention: the collections are not propagated.voidDeletes an eventintdeleteOccurrences(long parentId, boolean remindedOnly) Deletes all the occurrences of a given event, but not the event itelf.find(EventSearchCriteria searchCriteria) Finder method for events.findByAttendee(long attendeeId, Date start) Retrieves the events associated to the given attendeefindIdsByAttendeeAndDocument(Long attendeeId, Long documentId, Date start, Date endDate) Retrieves the identifiers of the events that have a given attendee.findIdsToNotify(Date start) Finds all the events that have to be notified.findOccurrences(long masterId, Date start, Date end) Retrieves the occurrences of a master eventfindUpcomingEvents(long attendeeId) Retrieves the even that will happen in the futurevoidscheduleEvent(Event event) Schedules the job for all the reminders or cancelations.voidSchedules the missfired events, used during the bootstrap.voidunscheduleEvent(long eventId) Unschedules the jobs of the given events and it's occurrencies.intupdateOccurrences(Event master) This will update all existing occurrences with the master's properties.Methods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Method Details- 
findByAttendeeList<Event> findByAttendee(long attendeeId, Date start) throws com.logicaldoc.core.PersistenceException Retrieves the events associated to the given attendee- Parameters:
- attendeeId- The id of one or the attendee
- start- oldest date for the events
- Returns:
- list of vents ordered by start asc
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findIdsByAttendeeAndDocumentList<Long> findIdsByAttendeeAndDocument(Long attendeeId, Long documentId, Date start, Date endDate) throws com.logicaldoc.core.PersistenceException Retrieves the identifiers of the events that have a given attendee.- Parameters:
- attendeeId- The id of one or the attendee
- documentId- The id of one of the documents
- start- oldest date for the event
- endDate- latest date for the event
- Returns:
- list of event Ids
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findUpcomingEventsRetrieves the even that will happen in the future- Parameters:
- attendeeId- identifier of the user that will have to attend to the events
- Returns:
- the future events order by descending start date
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findList<Event> find(EventSearchCriteria searchCriteria) throws com.logicaldoc.core.PersistenceException Finder method for events.- Parameters:
- searchCriteria- The criteria to be satisfied
- Returns:
- The list of events ordered by ascending date
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findIdsToNotifyFinds all the events that have to be notified. That are all those events with at least a reminder not already notified and after the passed date.- Parameters:
- start- date to consider, if null the current date will be used
- Returns:
- List of ids to be notified
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findOccurrencesRetrieves the occurrences of a master event- Parameters:
- masterId- identifier of the master event
- start- Oldest date, optional
- end- Latest date, optional
- Returns:
- list of events ordered by start asc
 
- 
createOccurrencesList<Long> createOccurrences(Event master, Date start, Date end) throws com.logicaldoc.core.PersistenceException This will create all the occurrences of a recurrent master event in a given time range.
 Attention: the collections are not propagated. All already reminded occurrences are left untouched.- Parameters:
- master- The starting point event
- start- Oldest date, optional
- end- Latest date, mandatory
- Returns:
- The list of ids of the newly created events
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
updateOccurrencesThis will update all existing occurrences with the master's properties.
 Attention: the collections are not propagated nor the timing attributes.- Parameters:
- master- The parent event
- Returns:
- The number of updated records
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
deleteOccurrencesint deleteOccurrences(long parentId, boolean remindedOnly) throws com.logicaldoc.core.PersistenceException Deletes all the occurrences of a given event, but not the event itelf.- Parameters:
- parentId- identifier of the parent event
- remindedOnly- Delete the reminded occurrences only
- Returns:
- Number of deleted events
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
cleanOldEventsint cleanOldEvents(int ttl) throws com.logicaldoc.core.PersistenceException This method deletes all the events oldest than the given days from now. Ifttlis 0 or -1, the cancellation is not made.
 Attention: Master events with a frequency will not be deleted.- Parameters:
- ttl- The maximum number of days over which the event is considered old
- Returns:
- Number of deleted events
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
deleteDeletes an event- Parameters:
- event- the event to elaborate
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
scheduleEventSchedules the job for all the reminders or cancelations. Do not invoke this directly it is used by the DAO itself.- Parameters:
- event- the event to elaborate
 
- 
unscheduleEventvoid unscheduleEvent(long eventId) Unschedules the jobs of the given events and it's occurrencies. Do not invoke this directly it is used by the DAO itself.- Parameters:
- eventId- the event to elaborate
 
- 
scheduleMissfiredEventsvoid scheduleMissfiredEvents() throws com.logicaldoc.core.PersistenceExceptionSchedules the missfired events, used during the bootstrap. Do not invoke this directly it is used by the DAO itself.- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
 
-