Skip to content

rrezartprebreza/spring-boot-skills / skills/spring-boot-3/spring-data-jpa

spring-data-jpa

Verified

Use when generating JPA entities, repositories, queries, or anything touching the persistence layer. Covers entity conventions, N+1 prevention, projections, and query patterns.

FileKindSize
SKILL.mdskill md6.2 KB
agents/openai.yamlconfig197 B
examples/bad-entity.javaother999 B
examples/good-entity.javaother2.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
}
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall