Class CalendarDaoImpl
java.lang.Object
ch.tocco.nice2.optional.calendar.impl.ical.CalendarDaoImpl
- All Implemented Interfaces:
CalendarDao
-
Constructor Summary
ConstructorDescriptionCalendarDaoImpl
(org.slf4j.Logger log, Context context, QueryBuilderFactory queryBuilderFactory, CalendarEventFactory calendarEventFactory, CreatedEntitiesPool createdEntities, CalendarManagerListenerService listenerService, CalendarEventContributionService contributionService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAndLinkCalendarEvent
(CalendarEvent event, Entity target) Saves the specified calendar event to db and links the target entity to the calendar event.void
addAndLinkCalendarEvent
(CalendarEvent event, String relationName, Entity target) void
deleteEvent
(UUID id, @Nullable Context ctx) int
deleteEvents
(EntityFilter eventFilter, @Nullable Context ctx) Delets all events that are returned by the query created from the specified event.findCalendar
(UUID eventId, EntityFilter calendarEventEntityFilter, @Nullable Context context) Finds the calendar of the specified event.findCalendars
(EntityFilter calendarEntityFilter, EntityFilter calendarEventEntityFilter, @Nullable Context context) @Nullable Entity
internalLoadCalendarByEventId
(UUID id, @Nullable Context ctx) void
linkEntity
(CalendarEvent event, Entity target) Links the specified entity to the calendar event.void
linkEntity
(CalendarEvent event, String relationName, Entity target) loadCalendar
(long id, EntityFilter calendarEventEntityFilter, @Nullable Context ctx) loadEvent
(UUID id, EntityFilter calendarEventEntityFilter, @Nullable Context ctx) Loads the calendar event with its calendar attached.Loads a 'shallow' calendar event specified by the id.loadEventEntity
(UUID id, @Nullable Context context) mapCalendar
(Entity calEntity, EntityFilter calendarEventEntityFilter) Creates aCalendar
object from the specified entity.mapCalendarEvent
(Entity calendarEventEntity) mapCalendarEvent
(Entity calendarEventEntity, EntityFilter calendarEventEntityFilter) resolveRelation
(CalendarEvent event, @Nullable Context ctx) resolveRelation
(CalendarEvent event, String relationName, @Nullable Context ctx) void
saveCalendar
(Calendar cal, @Nullable Context context) void
saveEvent
(CalendarEvent calendarEvent, @Nullable Context ctx) void
saveEventAndCalendarRelation
(CalendarEvent calendarEvent)
-
Constructor Details
-
CalendarDaoImpl
public CalendarDaoImpl(org.slf4j.Logger log, Context context, QueryBuilderFactory queryBuilderFactory, CalendarEventFactory calendarEventFactory, CreatedEntitiesPool createdEntities, CalendarManagerListenerService listenerService, CalendarEventContributionService contributionService)
-
-
Method Details
-
loadCalendar
public Calendar loadCalendar(long id, EntityFilter calendarEventEntityFilter, @Nullable @Nullable Context ctx) - Specified by:
loadCalendar
in interfaceCalendarDao
-
findCalendars
public List<Calendar> findCalendars(EntityFilter calendarEntityFilter, EntityFilter calendarEventEntityFilter, @Nullable @Nullable Context context) - Specified by:
findCalendars
in interfaceCalendarDao
-
findCalendar
public Calendar findCalendar(UUID eventId, EntityFilter calendarEventEntityFilter, @Nullable @Nullable Context context) Finds the calendar of the specified event.- Specified by:
findCalendar
in interfaceCalendarDao
-
mapCalendar
Description copied from interface:CalendarDao
Creates aCalendar
object from the specified entity. If target is not null, only events that are linked to this entity are returned.- Specified by:
mapCalendar
in interfaceCalendarDao
-
mapCalendarEvent
public CalendarEvent mapCalendarEvent(Entity calendarEventEntity, EntityFilter calendarEventEntityFilter) - Specified by:
mapCalendarEvent
in interfaceCalendarDao
-
mapCalendarEvent
- Specified by:
mapCalendarEvent
in interfaceCalendarDao
-
saveCalendar
- Specified by:
saveCalendar
in interfaceCalendarDao
-
loadEvent
Description copied from interface:CalendarDao
Loads a 'shallow' calendar event specified by the id. Shallow means, it has no calendar attached.- Specified by:
loadEvent
in interfaceCalendarDao
-
loadEventEntity
- Specified by:
loadEventEntity
in interfaceCalendarDao
-
loadEvent
public CalendarEvent loadEvent(UUID id, EntityFilter calendarEventEntityFilter, @Nullable @Nullable Context ctx) Description copied from interface:CalendarDao
Loads the calendar event with its calendar attached. The other calendar events that are loaded can be narrowed by the specified calendarEventEntityFilter.- Specified by:
loadEvent
in interfaceCalendarDao
-
deleteEvent
- Specified by:
deleteEvent
in interfaceCalendarDao
-
deleteEvents
Description copied from interface:CalendarDao
Delets all events that are returned by the query created from the specified event.- Specified by:
deleteEvents
in interfaceCalendarDao
- Returns:
- the number of events deleted
-
internalLoadCalendarByEventId
-
resolveRelation
public Relation resolveRelation(CalendarEvent event, String relationName, @Nullable @Nullable Context ctx) - Specified by:
resolveRelation
in interfaceCalendarDao
-
resolveRelation
- Specified by:
resolveRelation
in interfaceCalendarDao
-
linkEntity
- Specified by:
linkEntity
in interfaceCalendarDao
-
linkEntity
Description copied from interface:CalendarDao
Links the specified entity to the calendar event. The calendar event must be attached to a calendar and saved in the db.- Specified by:
linkEntity
in interfaceCalendarDao
-
addAndLinkCalendarEvent
- Specified by:
addAndLinkCalendarEvent
in interfaceCalendarDao
-
addAndLinkCalendarEvent
Description copied from interface:CalendarDao
Saves the specified calendar event to db and links the target entity to the calendar event. The calendar event must be attached to a calendar (callCalendar.addEvent(CalendarEvent)
for this).- Specified by:
addAndLinkCalendarEvent
in interfaceCalendarDao
- Parameters:
event
- a new eventtarget
- a target entity that is linked to the event
-
saveEvent
- Specified by:
saveEvent
in interfaceCalendarDao
-
saveEventAndCalendarRelation
- Specified by:
saveEventAndCalendarRelation
in interfaceCalendarDao
-