Skip to main content

14 docs tagged with "jpa"

View all tags

Domain Model

The entities, DTOs (Java Records), and enums that represent the core concepts of a loan application — and why each was designed the way it was.

Hibernate Basics for Spring Boot Developers

The Hibernate internals every Spring Boot developer must understand — SessionFactory vs Session thread safety, entity states, dirty checking, first-level cache, second-level cache, and LazyInitializationException.

JPA Basics — Entity Mapping and Relationships

How to map Java classes to database tables using @Entity, @Id, @GeneratedValue, and relationship annotations (@OneToMany, @ManyToOne), including fetch type defaults and their implications.

JPA Basics — Practical Demo

Hands-on code examples for JPA entity mapping, relationships, fetch types, and Spring Data auditing in a simple e-commerce domain.

Persistence Layer

How LoanApplication is mapped to H2 using JPA @Embeddable value objects, @ElementCollection for rejection reasons, and @PrePersist for UUID generation.

Spring Data Interview Questions

Consolidated interview Q&A for Spring Data JPA covering JPA mapping, repositories, transactions, N+1, projections, and caching — beginner through advanced.

Spring Data Overview

Quick-reference summary of Spring Data JPA — entity mapping, repository methods, transactions, N+1, projections, and caching.

Spring Data Projections

How to use interface projections, DTO projections, and dynamic projections in Spring Data JPA to select only the columns you need in a single optimized query.

Spring Data Repositories

How Spring Data JPA's repository interfaces (CrudRepository, JpaRepository) eliminate DAO boilerplate through query method derivation and @Query for JPQL and native SQL.

The N+1 Query Problem

What causes N+1 queries in JPA/Hibernate, how to diagnose them, and how to fix them with JOIN FETCH, @EntityGraph, DTO projections, and batch fetching.