askill
spring-boot-data-access

spring-boot-data-accessSafety 90Repository

Best practices for JPA, Hibernate, and Database interactions in Spring Boot

144 stars
2.9k downloads
Updated 1/27/2026

Package Files

Loading files...
SKILL.md

Spring Boot Data Access

Priority: P0

Implementation Guidelines

JPA & Hibernate

  • Read-Only: Default to @Transactional(readOnly = true) on Services. Override only on write methods.
  • Projections: Use Java Records for read-only queries. Avoid fetching full Entities.
  • Pagination: ALWAYS use Pageable for collections.
  • Open-In-View: Set spring.jpa.open-in-view=false to detect lazy loading issues early.

Query Optimization

  • N+1 Problem: Use JOIN FETCH (JPQL) or @EntityGraph for relationships.
  • Bulk Operations: Use @Modifying for batch updates/deletes to bypass Entity overhead.

Anti-Patterns

  • N+1 Selects: **No loops in loops**: Fetch eagerly or use graphs.
  • Logic in Queries: **No complex JPQL**: Use Service logic.
  • Returning Streams: **No raw Streams**: Use Lists or Page.

References

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/4/2026

High-quality technical reference for Spring Boot data access. Includes clear triggers, actionable guidelines, and common anti-patterns.

90
95
95
85
90

Metadata

Licenseunknown
Version-
Updated1/27/2026
PublisherHoangNguyen0403

Tags

No tags yet.