custom query

A repository query written out explicitly, usually with Spring Data's @Query annotation, instead of being derived from the method name.

In more detail

Custom queries make complex intent explicit and reviewable. JPQL, the Jakarta Persistence query language, looks like SQL but refers to entities and fields rather than tables and columns.

Example

@Query("select o from OrderEntity o where o.status = :status")

Related terms

Taught in

References