What is the role of the @EntityGraph annotation?
@EntityGraph in Spring Data JPA declares which associations a repository method loads in one query, which removes N+1 selects without making mappings eager.
2,886 posts about Java: questions with answers, tutorials and articles, newest first.
@EntityGraph in Spring Data JPA declares which associations a repository method loads in one query, which removes N+1 selects without making mappings eager.
Paginate native SQL in Spring Data JPA with Pageable and an explicit countQuery, handle sorting safely and use projections.
@NativeQuery is a Spring Data JPA shorthand for @Query(nativeQuery = true). See examples, JPA alternatives and when native SQL is the right choice.
Run database-specific SQL from JPA using EntityManager, named native queries or Spring Data @Query, with safe parameters, paging and projections.
@Column maps a JPA entity field to a database column and controls name, length, nullability, precision and insert or update behaviour. See clear examples.
Use @Table to control the table name and schema an entity maps to, plus constraints, indexes, a global default schema and reserved-word handling.
The JPA @Table annotation controls the table an entity maps to: its name, schema, constraints and indexes. Learn its attributes and its limits.
Cut SQL statements per request in JPA: fix N+1 with fetch joins, entity graphs and @BatchSize, use projections, and batch writes.
@BatchSize makes Hibernate load several lazy collections or entity proxies in one query. See how it fixes N+1 selects and how to configure it.
Learn how to define Apache Camel routes in a Spring Boot app with RouteBuilder beans, the REST DSL, Spring bean calls, routing rules and error handling.
Process large datasets in JPA without running out of memory: chunking, flush and clear, keyset paging, streaming, bulk JPQL and when to use Spring Batch.
@QueryHints attaches JPA and Hibernate hints to Spring Data JPA repository methods to tune timeouts, fetch size, read-only loading and query caching.
Prevent JPA deadlocks with consistent lock ordering and short transactions, and retry transient lock failures outside the transaction.
The Camel starter for Spring Boot manages a CamelContext, registers your routes as beans and lets you add components such as file or Kafka as needed.
Log Hibernate SQL statements and bind parameter values in Spring Boot 3 using the logging framework, with Hibernate 5 differences and production cautions.
@EntityListeners runs external listener classes on JPA lifecycle events such as persist, update and remove. Learn the callbacks, order and limits.
Log JPA SQL and bind values through SLF4J and Logback, find slow queries, and log entity lifecycle events with jakarta.persistence listeners.
Add camel-spring-boot-starter, write routes with RouteBuilder, use routing and splitting patterns, handle errors and test with mock endpoints.
@EnableTransactionManagement activates annotation-driven transactions for @Transactional. Learn proxy rules, rollback behavior and Boot defaults.
Make message consumption and database work succeed or fail together in Spring Boot, with JMS and Kafka examples and honest delivery guarantees.