BAEL-1412 add java 8 spring data features (#3306)
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
23f7f658e4
commit
ccf1f4ed27
@@ -2,9 +2,23 @@ package org.baeldung.repository;
|
||||
|
||||
import org.baeldung.model.User;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Repository("userRepository")
|
||||
public interface UserRepository extends JpaRepository<User, Integer> {
|
||||
public int countByStatus(int status);
|
||||
|
||||
int countByStatus(int status);
|
||||
|
||||
Optional<User> findOneByName(String name);
|
||||
|
||||
Stream<User> findAllByName(String name);
|
||||
|
||||
@Async
|
||||
CompletableFuture<User> findOneByStatus(Integer status);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user