# java-jpa-hibernate

Guides JPA entity mapping, query tuning, and transaction controls for Java persistence layers in production.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 613 installs · ★ 41
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-jpa-hibernate/SKILL.md
- Updated: 2026-01-05
- HTML: https://affpapa.org/en/nevibecode/skills/java-jpa-hibernate

## What it does

This skill guides assistants through entity modeling, Spring Data repositories, and Hibernate tuning. It focuses on targeted relational engines: `postgresql`, `mysql`, `oracle`, and `h2`. You get clear patterns for audit listeners, lifecycle callbacks, and locking strategies.

The included guidance tackles query bottlenecks. It outlines when to apply `JOIN FETCH`, dynamic `@EntityGraph` declarations, batch fetching with `@BatchSize`, or lightweight DTO projections. Configuration recipes cover HikariCP connection limits and second-level cache controls.

Leaving `open-in-view` enabled masks architectural defects until database traffic spikes unexpectedly during response rendering.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-jpa-hibernate -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/java-jpa-hibernate/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/java-jpa-hibernate/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-jpa-hibernate -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/java-jpa-hibernate/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-jpa-hibernate -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/java-jpa-hibernate/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-java java-jpa-hibernate
```

2. **Manually: put the files in place**
- File: `.github/skills/java-jpa-hibernate/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-jpa-hibernate -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-java --path skills/java-jpa-hibernate
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/java-jpa-hibernate/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-jpa-hibernate -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-jpa-hibernate/SKILL.md

## When to use it
- eliminate N+1 select bottlenecks in Spring Data queries
- map bidirectional entity relationships with audit fields
- configure JDBC batching and HikariCP connection pools
- apply optimistic or pessimistic locking to transactions

## Example prompts
- Refactor this repository query to use a DTO projection and prevent LazyInitializationException.
- Configure batch insert properties and connection pool limits for PostgreSQL in application.yml.
- Add an @EntityGraph to fetch order items and avoid secondary queries.

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

From the same set: [pluginagentmarketplace/custom-plugin-java](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-java.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
