rrezartprebreza/spring-boot-skills / skills/spring-boot-3/spring-data-jpa
spring-data-jpa
VerifiedUse when generating JPA entities, repositories, queries, or anything touching the persistence layer. Covers entity conventions, N+1 prevention, projections, and query patterns.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.2 KB |
| agents/openai.yaml | config | 197 B |
| examples/bad-entity.java | other | 999 B |
| examples/good-entity.java | other | 2.0 KB |
examples/bad-entity.java
View on GitHub// BAD — every common JPA mistake
@Entity
@Data // @Data generates setters — bad for entities
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY) // exposes auto-increment Long
private Long id; // Long ID, not UUID
private String customerEmail; // missing @Column constraints
@Enumerated(EnumType.ORDINAL) // ORDINAL breaks if enum is reordered
private OrderStatus status;
@OneToMany // missing cascade, orphanRemoval
private List<OrderItem> items; // not initialized — NPE waiting to happen
@ManyToOne // missing fetch = LAZY — EAGER by default = N+1
private User user;
// No @CreationTimestamp / @UpdateTimestamp
// No @Version for optimistic locking
// No factory method — public constructor allows invalid state
// No behavior methods — service has to know internal rules
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |