spring-data-mybatis
spring-data-mybatis copied to clipboard
support async query results
Repository queries can be executed asynchronously using Spring’s asynchronous method execution capability. This means the method will return immediately upon invocation and the actual query execution will occur in a task that has been submitted to a Spring TaskExecutor.
@Async
Future<User> findByFirstname(String firstname);
@Async
CompletableFuture<User> findOneByFirstname(String firstname);
@Async
ListenableFuture<User> findOneByLastname(String lastname);
- Use java.util.concurrent.Future as return type.
- Use a Java 8 java.util.concurrent.CompletableFuture as return type.
- Use a org.springframework.util.concurrent.ListenableFuture as return type.