Package org.duracloud.mill.db.repo
Interface JpaManifestItemRepo
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ManifestItem,Long>,org.springframework.data.jpa.repository.JpaRepository<ManifestItem,Long>,org.springframework.data.repository.PagingAndSortingRepository<ManifestItem,Long>,org.springframework.data.repository.query.QueryByExampleExecutor<ManifestItem>,org.springframework.data.repository.Repository<ManifestItem,Long>
@Repository("manifestItemRepo") public interface JpaManifestItemRepo extends org.springframework.data.jpa.repository.JpaRepository<ManifestItem,Long>- Author:
- Daniel Bernstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteByAccountAndStoreIdAndSpaceId(String account, String storeId, String spaceId)intdeleteFirst50000ByDeletedTrueAndModifiedBefore(Date expiration)ManifestItemfindByAccountAndStoreIdAndSpaceIdAndContentId(String account, String storeId, String spaceId, String contentId)List<ManifestItem>findByAccountAndStoreIdAndSpaceIdAndDeletedFalse(String account, String storeId, String spaceId, long lastId, int limit)org.springframework.data.domain.Page<ManifestItem>findByAccountAndStoreIdAndSpaceIdAndDeletedFalseOrderByContentIdAsc(String account, String storeId, String spaceId, org.springframework.data.domain.Pageable pageable)longgetMinId(String account, String storeId, String spaceId)Returns the minimum id value for the specified data set.Object[]getStorageStatsByAccountAndStoreIdAndSpaceId(String account, String storeId, String spaceId)Returns an array with the following values: [item_count,byte_count]-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, delete, delete, deleteAll, exists, findOne, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlush
-
-
-
-
Method Detail
-
findByAccountAndStoreIdAndSpaceIdAndDeletedFalseOrderByContentIdAsc
org.springframework.data.domain.Page<ManifestItem> findByAccountAndStoreIdAndSpaceIdAndDeletedFalseOrderByContentIdAsc(String account, String storeId, String spaceId, org.springframework.data.domain.Pageable pageable)
- Parameters:
account-storeId-spaceId-pageable-- Returns:
-
findByAccountAndStoreIdAndSpaceIdAndDeletedFalse
@Query(nativeQuery=true, value="select * from manifest_item where account = ?1 and store_id=?2 and space_id = ?3 and deleted = false and id > ?4 order by id limit ?5") List<ManifestItem> findByAccountAndStoreIdAndSpaceIdAndDeletedFalse(String account, String storeId, String spaceId, long lastId, int limit)- Parameters:
account-storeId-spaceId-lastId- The last id of the previous page. If there was no previous page, we recommend that you use the minimum id minus 1 in the unpaged set for optimum performance.limit-- Returns:
-
getMinId
@Query(nativeQuery=true, value="select ifnull(min(id),0) from manifest_item where account = ?1 and store_id=?2 and space_id = ?3 and deleted = false") long getMinId(String account, String storeId, String spaceId)Returns the minimum id value for the specified data set.- Parameters:
account-storeId-spaceId-- Returns:
-
findByAccountAndStoreIdAndSpaceIdAndContentId
ManifestItem findByAccountAndStoreIdAndSpaceIdAndContentId(String account, String storeId, String spaceId, String contentId)
- Parameters:
account-storeId-spaceId-contentId-- Returns:
-
deleteFirst50000ByDeletedTrueAndModifiedBefore
@Modifying @Query(nativeQuery=true, value="delete from manifest_item where deleted = true and modified < ?1 limit 50000") int deleteFirst50000ByDeletedTrueAndModifiedBefore(Date expiration)- Parameters:
expiration-
-
deleteByAccountAndStoreIdAndSpaceId
void deleteByAccountAndStoreIdAndSpaceId(String account, String storeId, String spaceId)
-
getStorageStatsByAccountAndStoreIdAndSpaceId
@Query(nativeQuery=true, value="select count(*) objectCount, sum(content_size) as byteCount from manifest_item where account = :account and store_id = :storeId and space_id= :spaceId and deleted=false") Object[] getStorageStatsByAccountAndStoreIdAndSpaceId(@Param("account") String account, @Param("storeId") String storeId, @Param("spaceId") String spaceId)Returns an array with the following values: [item_count,byte_count]- Parameters:
account-storeId-spaceId-- Returns:
-
-