@@ -20,6 +20,7 @@ import java.util.UUID;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
@@ -32,7 +33,7 @@ import org.springframework.data.rest.core.annotation.RestResource;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
|
||||
public interface PersonRepository extends PagingAndSortingRepository<Person, UUID> {
|
||||
public interface PersonRepository extends PagingAndSortingRepository<Person, UUID>, CrudRepository<Person, UUID> {
|
||||
|
||||
@RestResource(rel = "firstname", path = "firstname")
|
||||
Page<Person> findByFirstName(@Param("firstName") String firstName, Pageable pageable);
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
@@ -36,7 +37,7 @@ import org.springframework.format.annotation.DateTimeFormat.ISO;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
|
||||
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
|
||||
public interface PersonRepository extends PagingAndSortingRepository<Person, Long>, CrudRepository<Person, Long> {
|
||||
|
||||
@RestResource(rel = "firstname", path = "firstname")
|
||||
Page<Person> findByFirstName(@Param("firstname") String firstName, Pageable pageable);
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.data.rest.tests.mongodb;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
@@ -25,7 +26,7 @@ import org.springframework.data.repository.query.Param;
|
||||
* @author Jon Brisbin
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public interface ProfileRepository extends PagingAndSortingRepository<Profile, String> {
|
||||
public interface ProfileRepository extends PagingAndSortingRepository<Profile, String>, CrudRepository<Profile, String> {
|
||||
|
||||
List<Profile> findByType(String type);
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@ import java.util.List;
|
||||
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
|
||||
import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer;
|
||||
import org.springframework.data.querydsl.binding.QuerydslBindings;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
/**
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public interface UserRepository extends PagingAndSortingRepository<User, BigInteger>, QuerydslPredicateExecutor<User>,
|
||||
public interface UserRepository extends PagingAndSortingRepository<User, BigInteger>, CrudRepository<User, BigInteger>, QuerydslPredicateExecutor<User>,
|
||||
QuerydslBinderCustomizer<QUser> {
|
||||
|
||||
List<User> findByFirstname(String firstname);
|
||||
|
||||
Reference in New Issue
Block a user