4b4e6fcf7506b0570993cf27e533a10f3037a871
[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.querydsl.QueryDslPredicateExecutor;
6 import org.springframework.data.repository.PagingAndSortingRepository;
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 PagingAndSortingRepository<AdDescription, Long>, QueryDslPredicateExecutor<AdDescription> {
19
20         // Custom Query method (useful when the offered methods by PagingAndSortingRepository are not enough)
21         Page<AdDescription> findByAd(Ad ad, Pageable pageable);
22 }