Mini Project: Student Repository with Spring Data JPA
Learn Mini Project: Student Repository with Spring Data JPA (Spring Data JPA, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Mini Real-Time Project: Student Repository with Spring Data JPA Problem A school keeps students in a database. Developers want to save and search them (by city, top scorers, name pattern) without writing SQL or JDBC code. Requirements Map a Student class to a table. Declare a repository interface only, with no implementation. Add derived queries from method names and one @Query. Save, find, count and delete. Concepts Used @Entity / @Id JpaRepository derived query methods @Query (JPQL) H2 in-memory database Maven Dependencies spring-boot-starter-data-jpa com.h2database:h2 Answer: complete...
More lessons in Spring Data JPA
- ORM, JPA and Hibernate
- Spring Data JPA
- 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