•
you declare an interface and Spring Data supplies the implementation at runtime; there is no class to write
•
findByLastNameAndAgeGreaterThan is parsed from the method name into a query, and a typo in the name fails at startup
•
@Query for JPQL, or nativeQuery=true for SQL, when the derived name would be unreadable or impossible
•
transient, managed, detached and removed, and what save actually does in each state
•
a managed entity modified inside a transaction is flushed at commit with no explicit save call
•
@ManyToOne and @OneToOne default to EAGER while collections default to LAZY, and both defaults surprise people
•
touching a lazy association after the persistence context closed, and how open-session-in-view hides the design problem
•
one query for the parents plus one per parent for the children; a join fetch or an @EntityGraph collapses it
•
Pageable and Sort, and that a Page costs an extra count query where a Slice does not
•
spring.jpa.hibernate.ddl-auto is a development convenience; Flyway or Liquibase is the production answer
•
Boot 4 sits on jakarta.persistence, so every javax.persistence import must move
•
a @Version column detects a concurrent write and fails the second one instead of losing it
•
@Lock takes a database lock for the duration, trading throughput for certainty
•
the side without mappedBy owns the foreign key; the other side is a mirror
•
the in-memory graph is only consistent if you set both sides yourself
•
cascade propagates operations; orphanRemoval deletes a child that is detached from its parent
•
IDENTITY forces an insert per row and defeats JDBC batching; SEQUENCE can pre-allocate
•
an @Embeddable has no identity of its own and maps into the owning table
•
subclasses share one table plus a discriminator, trading nullable columns for speed
•
a generated id is null before persist, so equals/hashCode built on it breaks in sets
•
the first level is per persistence context; the second is shared and needs invalidation
•
a bulk UPDATE or DELETE leaves stale managed entities unless the context is cleared
•
fetching only the fields a screen needs avoids loading whole entity graphs
•
Hibernate only batches when batch size is set and the id strategy allows it
•
the persistence context grows without bound in a long loop unless you clear it
•
Spring Data JDBC has no lazy loading, dirty checking, or persistence context
•
use plain SQL when the mapping cost of an ORM buys nothing
•
a pool too small queues requests; the default is HikariCP and it is usually right
•
routing reads to a replica needs an explicit routing DataSource, not a property
•
@CreatedDate and @LastModifiedDate need auditing switched on to populate at all