Package org.exoplatform.caldav.dao
Interface CaldavObjectSyncDAO
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<CaldavObjectSyncEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<CaldavObjectSyncEntity,,Long> org.springframework.data.repository.ListCrudRepository<CaldavObjectSyncEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<CaldavObjectSyncEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<CaldavObjectSyncEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<CaldavObjectSyncEntity>,org.springframework.data.repository.Repository<CaldavObjectSyncEntity,Long>
public interface CaldavObjectSyncDAO
extends org.springframework.data.jpa.repository.JpaRepository<CaldavObjectSyncEntity,Long>
Persistence access to the object mappings.
Every listing here is paginated without exception: a calendar's object count is the user's, not the developer's, to decide, and a busy shared calendar is exactly the one whose full read would hurt.
-
Method Summary
Modifier and TypeMethodDescriptionlongcountByCalendarSyncId(long calendarSyncId) How many objects a pair maps.intdeleteByCalendarSyncId(long calendarSyncId) Drops every mapping of a pair.booleanexistsByLocalEventId(long localEventId) Whether an eXo event is already mapped anywhere.org.springframework.data.domain.Page<CaldavObjectSyncEntity> findByCalendarSyncId(long calendarSyncId, org.springframework.data.domain.Pageable pageable) One page of a pair's object mappings.findByCalendarSyncIdAndIcsUid(long calendarSyncId, String icsUid) The mapping for one iCalendar object inside a pair.findByCalendarSyncIdAndLocalEventId(long calendarSyncId, long localEventId) The mapping for one eXo event inside a pair.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByCalendarSyncIdAndIcsUid
The mapping for one iCalendar object inside a pair. The identity lookup the engine performs before every write.- Parameters:
calendarSyncId- the pairicsUid- the iCalendar UID- Returns:
- the mapping, if the object is already known
-
findByCalendarSyncIdAndLocalEventId
Optional<CaldavObjectSyncEntity> findByCalendarSyncIdAndLocalEventId(long calendarSyncId, long localEventId) The mapping for one eXo event inside a pair.- Parameters:
calendarSyncId- the pairlocalEventId- the eXo event- Returns:
- the mapping, if the event has been pushed
-
findByCalendarSyncId
org.springframework.data.domain.Page<CaldavObjectSyncEntity> findByCalendarSyncId(long calendarSyncId, org.springframework.data.domain.Pageable pageable) One page of a pair's object mappings.- Parameters:
calendarSyncId- the pairpageable- page and sort; required- Returns:
- one page of mappings
-
countByCalendarSyncId
long countByCalendarSyncId(long calendarSyncId) How many objects a pair maps.- Parameters:
calendarSyncId- the pair- Returns:
- the mapping count
-
existsByLocalEventId
boolean existsByLocalEventId(long localEventId) Whether an eXo event is already mapped anywhere. The backfill's idempotence check, asked once per event rather than per pair.- Parameters:
localEventId- the eXo event- Returns:
- true when a mapping exists
-
deleteByCalendarSyncId
@Modifying @Transactional @Query("DELETE FROM CaldavObjectSyncEntity o WHERE o.calendarSyncId = :calendarSyncId") int deleteByCalendarSyncId(@Param("calendarSyncId") long calendarSyncId) Drops every mapping of a pair. Called when a pair is unbound; the foreign key would cascade on a row delete, but a pair is often kept as a tombstone while its objects are not.- Parameters:
calendarSyncId- the pair- Returns:
- how many mappings were removed
-