Spring Data JPA

A Spring project that generates repository implementations from interfaces, so declaring an interface is enough to get common database operations.

In more detail

Extending JpaRepository<Entity, IdType> provides save, findById, findAll and more. Methods named by convention, such as findByStatus, become queries automatically, and @Query states more complex ones. Keep repository interfaces small so controllers never depend on database vocabulary.

Example

public interface OrderRepository extends JpaRepository<OrderEntity, String> { List<OrderEntity> findByStatus(String status); }

Related terms

Taught in

References