Skip to content

Migrate ULIDIdGenerator to Hibernate ORM 7 (0.3.0-hu) - #3

Merged
bauna merged 1 commit into
mainfrom
hibernate7
Jul 13, 2026
Merged

Migrate ULIDIdGenerator to Hibernate ORM 7 (0.3.0-hu)#3
bauna merged 1 commit into
mainfrom
hibernate7

Conversation

@bauna

@bauna bauna commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ULIDIdGenerator.generate() called EntityPersister#getClassMetadata(), which Hibernate ORM 7 removed — every generated insert on an H7 consumer (e.g. marty) throws NoSuchMethodError. This ports the generator to the H7 APIs: the new configure(GeneratorCreationContext, Properties) signature and persister.getIdentifier(object, session) directly.
  • Bumps the fork to 0.3.0-hu (breaking: requires Hibernate 7; H6 users stay on 0.2.1-hu), moves hibernate-core to org.hibernate.orm:7.2.19.Final in provided scope so consumers bring their own Hibernate, and raises Java to 17 (H7 baseline).
  • Adds Hibernate 7 + H2 integration tests doing real inserts for all four supported id types (ULID/UUID/String/byte[]) plus the pre-existing-id branch — the integration previously had zero coverage, which is how this break shipped.
  • Fixes ci.yml (temurin 17, pure Maven verify, gradle leftovers removed), deletes the stale upstream Gradle/Sonatype release.yml, and documents the fork in the README.

Test plan

  • ./mvnw clean verify — 287 tests pass, including 5 new Hibernate 7 integration tests against in-memory H2
  • ./mvnw dependency:tree — hibernate-core is provided, no compile-scope Hibernate leaks to consumers
  • After merge: ./mvnw clean deploy to CodeArtifact, then point marty's @GenericGenerator back at io.github.jaspeen.ulid.hibernate.ULIDIdGenerator and delete its in-repo copy

🤖 Generated with Claude Code

ULIDIdGenerator.generate() called EntityPersister#getClassMetadata(),
removed in Hibernate 7, throwing NoSuchMethodError on every generated
insert. Port to the H7 APIs:

- configure(GeneratorCreationContext, Properties) replaces the removed
  configure(Type, Properties, ServiceRegistry) signature
- generate() uses persister.getIdentifier(object, session) directly

Also:
- Bump to 0.3.0-hu; hibernate-core org.hibernate.orm:7.2.19.Final as
  provided scope so consumers bring their own Hibernate; Java 17
- Add Hibernate 7 + H2 integration tests covering all four id types
  (ULID/UUID/String/byte[]) and the existing-id branch
- Fix ci.yml (temurin 17, pure Maven); delete stale Gradle release.yml
- README: Humand fork section with new coordinates and H7 requirement

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hu-reviewer

hu-reviewer Bot commented Jul 13, 2026

Copy link
Copy Markdown

🤖 Hu Reviewer

Last updated: 2026-07-13 19:20 UTC · commit 519227b · triggered by PR opened

Issues

0 open · ✅ 0 resolved

Runs

519227b (0 new)

@bauna
bauna merged commit 1da7948 into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant