hibernate-developer

Guides Hibernate 7 domain binding, mapping migration, and integration testing in grails-data-hibernate7.

2.9k|973|Updated Feb 10, 2010
One-click install
npx skills add https://github.com/apache/grails-core --skill hibernate-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hibernate-developer
Source: https://github.com/apache/grails-core/tree/main/.agents/skills/hibernate-developer
Command: npx skills add https://github.com/apache/grails-core --skill hibernate-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working on the grails-data-hibernate7 module requires deep knowledge of Hibernate 7 domain binding internals, binder class responsibilities, and module-specific testing constraints that generic Grails guidance does not cover.

Core Features & Use Cases

  • Binder Architecture Guidance: Maps responsibilities across GrailsDomainBinder, GrailsPropertyBinder, IdentityBinder, VersionBinder, collection binders, and generator classes.
  • Migration Support: Assists with porting domain-binding behavior from Hibernate 5 to Hibernate 7 and fixing H7 regressions.
  • Testing Rules: Enforces HibernateGormDatastoreSpec-based integration tests, top-level entity classes, and globally unique domain class names to avoid flaky parallel test failures.
  • Use Case: When fixing a Hibernate 7 regression in composite identifier binding, use this Skill to locate the owning binder class, preserve the unified binder-dispatch structure, and add a spec that exercises the real Hibernate mapping path.

Quick Start

Ask the assistant to help modify or debug domain binding code in the grails-data-hibernate7 module, such as fixing a composite identifier mapping regression.

Frequently Asked Questions about hibernate-developer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I modify Hibernate 7 domain binding in Grails?

Start with GrailsDomainBinder, the central coordinator for Hibernate 7 mapping contribution, then identify the specific binder owning the behavior such as IdentityBinder, VersionBinder, or CollectionBinder. Preserve the unified binder-dispatch structure in GrailsPropertyBinder rather than adding ad hoc branching.

How do I write integration tests for grails-data-hibernate7?

Use HibernateGormDatastoreSpec for Hibernate 7 integration and domain-binding specifications. Register entities with manager.registerDomainClasses in setupSpec, define test entities as top-level classes in the spec file, and prefer real entities over heavy mocking.

Why do Hibernate 7 specs fail intermittently in parallel test runs?

The test suite uses maxParallelForks greater than 1, and HibernateDatastore caches mapping metadata by entity class name. Two specs registering a domain class with the same simple name in the same package overwrite each other's mappings, so keep domain class names globally unique per package.

Does this guidance apply to Grails application development?

No, this guidance targets the Grails framework's Hibernate 7 integration module, not end-user Grails applications. User-facing application migration guides belong in grails-doc, while this covers framework-level binder and mapping infrastructure code.

When should I avoid refactoring GrailsIncrementGenerator?

GrailsIncrementGenerator contains reflection-based workarounds for accessing Hibernate 7 internals. Avoid broad refactors in that class unless the change explicitly targets that compatibility area, since the reflection code is intentional.