본문으로 건너뛰기
cccskills
무료GitHub에 공개

hibernate-developer

Guide for working in the grails-data-hibernate7 module, especially Hibernate 7 domain binding, mapping migration, generators, and integration tests. Use this when changing code or tests under grails-data-hibernate7.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- SPDX-License-Identifier: Apache-2.0 Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. -->

What I Do

  • Provide repository-specific guidance for the grails-data-hibernate7 project.
  • Guide changes around GrailsDomainBinder, GrailsPropertyBinder, IdentityBinder, VersionBinder, collection binders, and related utilities.
  • Keep changes aligned with the testing constraints used by the Hibernate 7 modules in this repository.
  • Help with migration work inside this framework module (e.g., porting domain-binding behaviour from H5 to H7, updating binder internals, fixing H7 regressions). Does not cover user-facing application migration guides; those belong in grails-doc.

When to Use Me

Activate this skill when working on the Hibernate 7 module, especially for:

  • Changes under grails-data-hibernate7/**.
  • Hibernate 7 mapping and metadata binding work.
  • Identifier, version, collection, association, or generator binding changes.
  • Hibernate 7 regression fixes and migration follow-up tasks.
  • Specs that exercise Hibernate-backed mapping behavior rather than lightweight unit behavior.

Module Context

This skill is for the Grails framework's Hibernate 7 integration module, not for a Grails application. Prefer guidance from this skill over generic Grails app patterns when working in grails-data-hibernate7.

GrailsDomainBinder is the main entry point for binding Grails domain classes to Hibernate metadata. Changes often ripple through:

  • org.grails.orm.hibernate.cfg
  • org.grails.orm.hibernate.cfg.domainbinding
  • org.grails.orm.hibernate.cfg.domainbinding.collectionType
  • org.grails.orm.hibernate.cfg.domainbinding.secondpass
  • org.grails.orm.hibernate.cfg.domainbinding.generator

Key Classes and Responsibilities

Main Binding Flow

  • GrailsDomainBinder: central coordinator for Hibernate 7 mapping contribution.
  • GrailsPropertyBinder: main coordinator for converting persistent properties into Hibernate Value instances.
  • PropertyFromValueCreator: shared utility for creating Hibernate Property instances from a bound Value.

Identifier and Version Binding

  • IdentityBinder: coordinates identifier binding.
  • SimpleIdBinder: handles simple identifiers.
  • CompositeIdBinder: handles composite identifiers.
  • VersionBinder: binds optimistic locking version properties.
  • NaturalIdentifierBinder: binds naturalId properties.

Associations and Collections

  • OneToOneBinder, ManyToOneBinder, ManyToOneValuesBinder: association binding.
  • CollectionBinder: collection mapping.
  • CollectionSecondPassBinder, ListSecondPassBinder, MapSecondPassBinder: second-pass association and collection binding.
  • CollectionHolder plus the collection type classes: carry collection metadata through binding.

Value and Column Binding

  • SimpleValueBinder: binds simple properties.
  • SimpleValueColumnBinder: binds columns to simple values.
  • ComponentBinder, ComponentPropertyBinder: embedded/component binding.
  • EnumTypeBinder: enum mapping.

Generators

  • BasicValueCreator: creates identifier values and generators.
  • GrailsSequenceWrapper, GrailsSequenceGeneratorEnum: generator integration helpers.
  • GrailsIdentityGenerator, GrailsIncrementGenerator, GrailsNativeGenerator, GrailsSequenceStyleGenerator, GrailsTableGenerator: Grails-specific Hibernate 7 generator implementations.

Current Module Guidance

Keep these module-specific expectations in mind:

  • GrailsPropertyBinder has already been simplified to a unified binder-dispatch structure. Preserve that consolidation instead of reintroducing scattered property creation or ad hoc branching.
  • Property creation and addition should stay centralized through callers using PropertyFromValueCreator where applicable.
  • Utility classes in domainbinding.util should prefer Hibernate-aware GORM types internally, but public signatures may still need base interfaces when Spock mocks require them.
  • GrailsIncrementGenerator still contains reflection-based Hibernate 7 compatibility workarounds; avoid broad refactors unless the change explicitly addresses that area.

Testing Rules

When touching grails-data-hibernate7, test through real Hibernate wiring rather than assuming mocks are enough.

  • Use HibernateGormDatastoreSpec for Hibernate 7 integration and domain-binding specifications.
  • Prefer manager.registerDomainClasses(...) in setupSpec() to register entities for specs.
  • Define test entities as top-level classes in the same Groovy spec file.
  • Ensure test domain class names are globally unique within the package. The test suite uses maxParallelForks > 1, so multiple specs can run concurrently in the same JVM fork. HibernateDatastore caches mapping metadata by entity class name, so two specs registering a domain class with the same simple name in the same package can overwrite each other's mappings and cause flaky failures.
  • Prefer real entities over heavy mocking for binder logic.

Change Workflow

  1. Identify which binder, creator, generator, fetcher, or second-pass class owns the behavior.
  2. Trace whether the change affects only Value creation, Property creation, or both.
  3. Preserve the existing separation between logical mapping decisions and Hibernate object construction.
  4. Update or add specs in grails-data-hibernate7 that exercise the affected behavior through the public Hibernate-backed path.
  5. Run the relevant Hibernate 7 module tests, and expand test coverage when binder flow or entity registration behavior changes.

Pitfalls to Avoid

  • Do not treat this module like a simple Grails application layer; it is framework and mapping infrastructure code.
  • Do not reintroduce duplicated property-creation logic if a shared binder or creator already owns it.
  • Do not rely on unit-only mocking for Hibernate internals when the behavior depends on real metadata binding.
  • Do not use nested or inner entity classes in Hibernate 7 specs when top-level classes are required for AST transforms and reliable registration.

Known Status and Constraints

  • The Hibernate 7 binder migration is complete: all main binders, collection types, second-pass binders, generators, and utilities have been migrated.
  • GrailsIncrementGenerator retains reflection-based workarounds for accessing Hibernate 7 internals; avoid broad refactors in that class unless explicitly targeting that area.

Source of Truth

This skill is the repository guidance for Hibernate 7 module work. When module conventions change, update this skill directly so agents load the current rules from .agents/skills/hibernate-developer/SKILL.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Expert guide for Gradle 9 builds in apache/grails-core on the 8.0.x line - multi-project topology, convention plugins, BOM platforms, dependency rules, task configuration hygiene, and repo-specific patterns that override generic Gradle docs

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

Guide for upgrading Grails applications from Grails 7.x to Grails 8, covering Java 21, Groovy 5 name resolution and static compilation, Spring Boot 4.1, Spring Framework 7, dependency management, Micronaut, Jackson 3, Hibernate 7, TagLibs, testing, content negotiation, asset pipeline wildcard paths, and validation behavior changes

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

Comprehensive guide for Grails development, covering web applications, REST APIs, GORM, controllers, services, views, plugins, and testing with Spock and Geb

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

Expert guide for Groovy 5 development, covering concise syntax, closures, DSLs, metaprogramming, static compilation, and integration with Java 21 and Grails

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

Guide for developing on the Java 21 baseline, including modern features, best practices, and integration with Groovy/Grails projects

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

Step-by-step process for merging a previously-standalone Grails plugin repository (e.g. grails-spring-security, grails-redis) into the grails-core monorepo as one or more Gradle subprojects, wiring it into the shared build, publishing, docs, and CI the same way the existing modules are.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

apache/grails-core2.9천2026년 10월 19일 업데이트

apache의 스킬 모두 보기

이 스킬의 문제 신고