Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.springframework.data.repository.history;

import java.util.Optional;
import java.util.Set;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -30,6 +31,7 @@
*
* @author Oliver Gierke
* @author Philipp Huegelmeyer
* @author Miguel Ángel Ruiz
*/
@NoRepositoryBean
public interface RevisionRepository<T, ID, N extends Number & Comparable<N>> extends Repository<T, ID> {
Expand All @@ -50,6 +52,15 @@ public interface RevisionRepository<T, ID, N extends Number & Comparable<N>> ext
*/
Revisions<N, T> findRevisions(ID id);

/**
* Returns all {@link Revisions} of an entity with the given id and filtered by the changed field of the entity.
*
* @param id must not be {@literal null}.
* @param changedFields must not be {@literal null}.
* @return
*/
Revisions<N, T> findRevisions(ID id, Set<String> changedFields);

/**
* Returns a {@link Page} of revisions for the entity with the given id. Note, that it's not guaranteed that
* implementations have to support sorting by all properties.
Expand All @@ -62,6 +73,19 @@ public interface RevisionRepository<T, ID, N extends Number & Comparable<N>> ext
*/
Page<Revision<N, T>> findRevisions(ID id, Pageable pageable);

/**
* Returns a {@link Page} of revisions for the entity with the given id and filtered by the changed field of
* the entity. Note, that it's not guaranteed that implementations have to support sorting by all properties.
*
* @param id must not be {@literal null}.
* @param changedFields must not be {@literal null}.
* @param pageable the pageable to request a paged result, can be {@link Pageable#unpaged()}, must not be
* {@literal null}.
* @see RevisionSort
* @return
*/
Page<Revision<N, T>> findRevisions(ID id, Set<String> changedFields, Pageable pageable);

/**
* Returns the entity with the given ID in the given revision number.
*
Expand Down