OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add affaan-m/ecc --skill jpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot. Use when designing JPA entities or relationships, or when a Hibernate query, transaction, or N+1 problem needs fixing.
npx skills add affaan-m/ecc --skill jpa-patterns
Use for data modeling, repositories, and performance tuning in Spring Boot.
Enable auditing:
JOIN FETCH in queries when neededEAGER on collections; use DTO projections for read paths@Transactional@Transactional(readOnly = true) for read paths to optimizeFor cursor-like pagination, include id > :lastId in JPQL with ordering.
status, slug, foreign keys)status, created_at)select *; project only needed columnssaveAll and hibernate.jdbc.batch_sizeRecommended properties:
For PostgreSQL LOB handling, add:
@DataJpaTest with Testcontainers to mirror productionlogging.level.org.hibernate.SQL=DEBUG and logging.level.org.hibernate.orm.jdbc.bind=TRACE for parameter valuesRemember: Keep entities lean, queries intentional, and transactions short. Prevent N+1 with fetch strategies and projections, and index for your read/write paths.