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 Type
    Method
    Description
    long
    countByCalendarSyncId(long calendarSyncId)
    How many objects a pair maps.
    int
    deleteByCalendarSyncId(long calendarSyncId)
    Drops every mapping of a pair.
    boolean
    existsByLocalEventId(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, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByCalendarSyncIdAndIcsUid

      Optional<CaldavObjectSyncEntity> findByCalendarSyncIdAndIcsUid(long calendarSyncId, String icsUid)
      The mapping for one iCalendar object inside a pair. The identity lookup the engine performs before every write.
      Parameters:
      calendarSyncId - the pair
      icsUid - 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 pair
      localEventId - 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 pair
      pageable - 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