jpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
npx skills add vibeeval/vibecosystem --skill jpa-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# JPA/Hibernate Patterns Use for data modeling, repositories, and performance tuning in Spring Boot. ## Entity Design ```java @Entity @Table(name = "markets", indexes = { @Index(name = "idx_markets_slug", columnList = "slug", unique = true) }) @EntityListeners(AuditingEntityListener.class) public class MarketEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 200) private String name; @Column(nullable = false, unique = true, length = 120) private String slug; @Enumerated(EnumType.STRING) private MarketStatus status = MarketStatus.ACTIVE; @CreatedDate private Instant createdAt; @LastModifiedDate private Instant updatedAt; } ``` Enable auditing: ```java @Configuration @EnableJpaAuditing class JpaConfig {} ``` ## Relationships and N+1 Prevention ```java @OneToMany(mappedBy = "market", cascade = CascadeType.ALL, orphanRemoval = true) private List<PositionEntity> positions = new ArrayList<>(); ``` - Default to lazy loading; use `JOIN FETCH` in queries when needed - Avoid `EAGER` on collections; use DTO projections for read paths ```java @Query("select m from MarketEntity m left join fetch m.positions where m.id = :id") Opt
- Entity Design
- Relationships and N+1 Prevention
- Repository Patterns
- Transactions
- Pagination
- Indexing and Performance
- Connection Pooling (HikariCP)
- Caching
- Migrations
- Testing Data Access
What does the jpa-patterns skill do?
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
How do I install it?
Run `npx skills add vibeeval/vibecosystem --skill jpa-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
