diff --git a/src/main/java/org/springframework/data/repository/history/RevisionRepository.java b/src/main/java/org/springframework/data/repository/history/RevisionRepository.java index 5df0446dd4..6fd019eef3 100755 --- a/src/main/java/org/springframework/data/repository/history/RevisionRepository.java +++ b/src/main/java/org/springframework/data/repository/history/RevisionRepository.java @@ -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; @@ -30,6 +31,7 @@ * * @author Oliver Gierke * @author Philipp Huegelmeyer + * @author Miguel Ángel Ruiz */ @NoRepositoryBean public interface RevisionRepository> extends Repository { @@ -50,6 +52,15 @@ public interface RevisionRepository> ext */ Revisions 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 findRevisions(ID id, Set 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. @@ -62,6 +73,19 @@ public interface RevisionRepository> ext */ Page> 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> findRevisions(ID id, Set changedFields, Pageable pageable); + /** * Returns the entity with the given ID in the given revision number. *