hibernate-orm-persistence

hibernate-orm-persistence is a skill for Claude Code from vaquarkhan/Fullstack-development-agent-skills. It costs 47 tokens per session (548 once invoked), scanned A, original, MIT.

Guidance for storing and querying application data in relational databases with Hibernate ORM, a Java tool that maps database tables to objects.

In plain words
What is it for?
Use it to design entities and relationships, write HQL or Criteria queries, plan which related data to fetch, configure caching, and check database query counts in tests.
Why use it?
It helps avoid common persistence problems such as unnecessarily loaded data, excessive database queries, unsafe concurrent updates, and poorly planned caching.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the fullstack-development-agent-skills plugin — 129 skills, 10 commands shipped together

Good fit Use it to design entities and relationships, write HQL or Criteria queries, plan which related data to fetch, configure caching, and check database query counts in tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vaquarkhan/fullstack-development-agent-skills/hibernate-orm-persistence
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vaquarkhan/Fullstack-development-agent-skills --skill hibernate-orm-persistence
Clone the repo
git clone --depth 1 https://github.com/vaquarkhan/Fullstack-development-agent-skills

Made for: Claude Code.

Or install fullstack-development-agent-skills, the plugin that ships this one along with the rest of its 129 skills, 10 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hibernate-orm-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/hibernate-orm-persistence.svg)](https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/hibernate-orm-persistence)
Your own site
<a href="https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/hibernate-orm-persistence"><img src="https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/hibernate-orm-persistence.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 548 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.00548
Opus 5 $0.00023 $0.00274
Sonnet 5 $0.00009 $0.00110
Haiku 4.5 $0.00005 $0.00055

Measured 7d ago against content hash ace1bf2bca87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

hibernate-orm-persistence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill-packs/java/hibernate/hibernate-orm-persistence/SKILL.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hibernate ORM Persistence

Use When

  • Complex entity graphs, inheritance, or custom SQL require full Hibernate control
  • N+1 queries, fetch joins, or second-level cache tuning are needed
  • Working with Hibernate directly (Jakarta EE) or via Spring Data JPA with native Hibernate features

Workflow

  1. Model entities with clear aggregate roots; prefer FetchType.LAZY associations.
  2. Define equals/hashCode on business keys — not database IDs for transient entities.
  3. Use @NamedQuery, JPQL, or Criteria API; native SQL only when justified.
  4. Tune fetch plans: @EntityGraph, join fetch, or DTO projections for read paths.
  5. Enable query logging in dev; verify query count in tests for list endpoints.

Required Checks

  • No EAGER collections on high-cardinality associations without explicit justification
  • @Version optimistic locking on concurrent update entities
  • Batch size (@BatchSize or hibernate.default_batch_fetch_size) for collection fetching
  • Second-level cache only with explicit invalidation strategy

Examples And Templates

See examples/ for side-by-side good vs bad patterns agents commonly get wrong. See templates/ for copy-paste starters aligned with this skill.

Decision Framework

  • Prefer Spring Data repositories for simple CRUD; drop to Hibernate API for complex queries.
  • Use @SqlResultSetMapping or Blaze Persistence for heavy reporting queries.
  • Prefer merge vs persist semantics consciously in service layer.
  • Schema changes via Flyway/Liquibase — Hibernate ddl-auto=validate in production.

Common Rationalizations And Rebuttals

  • "EAGER loading prevents LazyInitializationException." -> Fix session boundaries and fetch plans; EAGER causes cartesian product queries.
  • "Hibernate generates schema in prod." -> Use migrations; ddl-auto validate only.
  • "Lombok @Data on entities is fine." -> Breaks entity equality and can trigger unnecessary updates.

Evidence Pack

  • Entity relationship diagram with fetch types annotated
  • Query count assertion for critical list/read endpoints
  • Migration scripts aligned with entity model
  • N+1 fix evidence (before/after query logs)

Read the full file on GitHub · 60 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 60 lines · 47 tokens per session scan A ace1bf2bca87

Subscribe to this mod's changes

hibernate-orm-persistence is a skill published in the GitHub repository vaquarkhan/Fullstack-development-agent-skills (2 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 548 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ruoyi-cloud

Use when scaffolding Java Spring Cloud microservice backends — Nacos service discovery, Sentinel rate limiting, Seata distributed transactions, Spring Boot 3 + Vue 3 admin. RuoYi-Cloud: popular Chinese Spring Cloud microservice boilerplate framework.

znlgis/opengis-skills · 56 tokens

others-skills

Use when needing Go language development, desktop RPA automation, self-hosted email marketing, Java Spring Cloud scaffolding, or SSL/TLS certificate automation. Index of 6 skills: Go, RobotGo, RobotGo-Flow, BillionMail, RuoYi-Cloud, acme.sh.

znlgis/opengis-skills · 64 tokens

spring-boot

Spring Boot 3.x - Java framework for production-ready applications with dependency injection, REST APIs, data access, security, and actuator monitoring.

bobmatnyc/claude-mpm-skills · 31 tokens

spring-boot-4-conventions

Spring Framework 7 / Spring Boot 4 idioms and defaults. Use when writing or reviewing controllers, services, configuration, HTTP clients, async/virtual-thread code, or anything touching Spring's programming model.

loiane/specs-driven-development-spring-angular · 50 tokens

quarkus-expert

High-performance Quarkus framework expertise covering reactive patterns, CDI, build-time augmentation, and cloud-native development. Use for general Quarkus questions.

kinhluan/rules-quarkus-skills · 36 tokens

senior-java

World-class Java and Spring Boot development skill for enterprise applications, microservices, and cloud-native systems. Expertise in Spring Framework, Spring Boot 3.x, Spring Cloud, JPA/Hibernate, and reactive programming with WebFlux. Includes project scaffolding, dependency management, security implementation, and…

xuansenpa1/skillrevise · 65 tokens