Spring Data repository method return type errors
Reports Spring Data CRUD repository methods with incorrect return types.
The following return types are supported:
void
Primitive types
Wrapper types
T
when the query method is expected to return one result at most. Returnsnull
if there are no results and throwsIncorrectResultSizeDataAccessException
if there is more than one result.java.util.List
or any commonIterable
typejava.util.stream.Stream
java.util.Optional
orscala.Option
when the query method is expected to return one result at most. ReturnsOptional.empty()
orOptional.absent()
if there are no results and throwsIncorrectResultSizeDataAccessException
if there is more than one result.io.micronaut.data.model.Page
io.micronaut.data.model.Slice
java.util.concurrent.Future
,java.util.concurrent.CompletableFuture
, orListenableFuture
if the method is annotated with@Async
and Spring asynchronous method execution is enabledGeoResults<T>
,GeoResult<T>
, orGeoPage<T>
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
SpringDataRepositoryMethodReturnTypeInspection- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Spring Data, 243.26483 |