derived query method
A Spring Data repository method whose query is worked out from its name, such as findByStatus meaning select entities whose status equals the argument.
In more detail
Derived names suit simple filters. When a name grows long or the intent is complex, a custom query states it more clearly.
Example
List<OrderEntity> findByStatus(String status);Related terms
- Spring Data JPA — A Spring project that generates repository implementations from interfaces, so declaring an interface is enough to get common database operations.
- custom query — A repository query written out explicitly, usually with Spring Data's @Query annotation, instead of being derived from the method name.
Taught in
- Spring Data Repositories — Modern Java: Virtual Threads & High-Throughput Services
- Tying It All Together — Modern Java: Virtual Threads & High-Throughput Services