Spring Data JPA
Learn Spring Data JPA (Spring Data JPA, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Spring Data JPA is a part of the larger Spring Data family that makes it easy to work with relational databases in a Spring application. It sits on top of JPA (Java Persistence API) and Hibernate (the most common JPA implementation) and removes almost all of the boilerplate code (DAO classes, SQL statements, ResultSet mapping) that we normally have to write when talking to a database. The two building blocks we start with are: • @Entity - a plain Java class that represents a database table. • Repository interface - an interface that gives us ready-made methods to save, read, update and delete...
More lessons in Spring Data JPA
- ORM, JPA and Hibernate
- Entity Mapping: @Entity, @Table, @Id, @Column
- Derived Query Methods - Fetch by Single & Multiple Fields
- JPQL and @Modifying Queries
- Native Query with @Query
- Mapping - Real-World Scenarios
- Mapping - One-to-One & One-to-Many
- Mapping - Many-to-One & Many-to-Many
- Cascade Types and orphanRemoval
- Join Queries & DTO Projection
- JPA Advanced - Auditing, Locking & Specifications
- Mini Project: Student Repository with Spring Data JPA