Jpa Hibernate Pitfalls

Use when a JPA or Hibernate entity, repository or query is written or reviewed, or a Spring service touches the database: association fetch types and N+1 queries, LazyInitializationException, fetch joins and pagination, DTO projections, equals and hashCode on entities, Set versus List for associations, bidirectional association sync, IDENTITY versus sequence ids and JDBC batching, enum mapping, optimistic locking with a version column, bulk updates that bypass the persistence context, where @Transactional works and where it does not, open-in-view, and who creates the schema (Hibernate DDL versus Flyway or Liquibase).

techmefr Updated

File contents

techmefr/mentis commit 564bf7c562

Frequently asked questions

npx get-skill add techmefr/jpa-hibernate-pitfalls