1 package de.spring.example.services.impl;
3 import java.io.Serializable;
5 import org.springframework.data.domain.Page;
6 import org.springframework.data.domain.Pageable;
7 import org.springframework.data.history.Revision;
8 import org.springframework.data.repository.history.RevisionRepository;
9 import org.springframework.transaction.annotation.Transactional;
10 import org.springframework.util.Assert;
12 import de.spring.example.services.RevisionService;
14 public class RevisionServiceImpl<T, ID extends Serializable, N extends Number & Comparable<N>, R extends RevisionRepository<T, ID, N>>
15 implements RevisionService<T, ID, N> {
17 protected R repository;
20 * @param repository the repository to set
22 public void setRepository(R repository) {
23 this.repository = repository;
28 public Page<Revision<N, T>> findRevisions(ID id, Pageable pageable) {
29 Assert.notNull(pageable, "page request can't be null");
30 Assert.notNull(id, "Resource ID can't be null");
32 return this.repository.findRevisions(id, pageable);