817884ceb01420de227035d6c0ca3b30f20c3a11
[JavaForFun] /
1 package de.spring.example.persistence.repository;
2
3 import org.springframework.data.domain.Page;
4 import org.springframework.data.domain.Pageable;
5 import org.springframework.data.repository.PagingAndSortingRepository;
6 import org.springframework.data.repository.history.RevisionRepository;
7
8 import de.spring.example.persistence.domain.Ad;
9 import de.spring.example.persistence.domain.AdDescription;
10
11 /**
12  * By default <code>org.springframework.data.jpa.repository.support.SimpleJpaRepository<code>
13  * will be the implementation for this interface.
14  * 
15  * Be careful with <code>@Transactional</code>. SimpleJpaRepository has annotated methods.
16  *
17  */
18 public interface AdDescriptionRepository extends
19                 PagingAndSortingRepository<AdDescription, Long>,
20                 /** https://github.com/spring-projects/spring-data-envers/pull/45 QueryDslPredicateExecutor<AdDescription>, **/
21                 RevisionRepository<AdDescription, Long, Integer> {
22
23         // Custom Query method (useful when the offered methods by PagingAndSortingRepository are not enough)
24         Page<AdDescription> findByAd(Ad ad, Pageable pageable);
25 }