Skip to content

Update Hibernate and various other dependencies#2986

Open
gbrodman wants to merge 1 commit intogoogle:masterfrom
gbrodman:hibernate
Open

Update Hibernate and various other dependencies#2986
gbrodman wants to merge 1 commit intogoogle:masterfrom
gbrodman:hibernate

Conversation

@gbrodman
Copy link
Collaborator

@gbrodman gbrodman commented Mar 21, 2026

This ended up being wayyyyyy more complicated than expected due to issues with Hibernate, various dependencies having conflicts with the proto dependency version, and other breaking changes.

Notes:

  • Hibernate 7 switches up the user type / converter system and for us, this means we must be / want to be more explicit with how we convert and store things. For example, we need to add Postgres types to @Column definitions.
  • Hibernate 7.3 has an issue with generic MappedSuperclasses -- we have issues with BaseDomainLabelList. I'll investigate that, but for now let's stick with 7.2.x
  • H7 is more strict with annotations and prevents us from storing mapped superclasses embedded within other objects. This kinda makes sense but makes the History objects a bit more difficult. We had to add "concrete" embeddable DomainBase and HostBase objects that we can store/retrieve from the DB.
  • We convert some of the calls to "Query" to "TypedQuery" -- in Hibernate 8 / JPA 4.0 these will be super-deprecated and we'll need to shift everything over, so this is necessary.
  • You aren't supposed to put callback listeners on embedded entities (because it can be not obvious what's happening). We don't like that, so we add our own annotations that are processed recursively for embedded entities, so we get things like the update / create timestamps.
  • Hibernate doesn't allow for multiple converters to be auto-applied to the same "type" and it counts all VKey converters as one type. Unfortunately, this means we have to explicitly mark each one.
  • A bunch of other dependency changes were required to keep from having the proto 3/4 conflict

This change is Reviewable

@gbrodman gbrodman added the kokoro:force-run Force a Kokoro build. label Mar 23, 2026
@domain-registry-eng domain-registry-eng removed the kokoro:force-run Force a Kokoro build. label Mar 23, 2026
@gbrodman gbrodman force-pushed the hibernate branch 6 times, most recently from 1b15f8c to a8a0320 Compare March 23, 2026 20:45
@gbrodman gbrodman requested a review from weiminyu March 23, 2026 21:33
Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried in alpha or crash to verify handling of existing data?

@weiminyu reviewed 53 files and made 1 comment.
Reviewable status: 53 of 91 files reviewed, all discussions resolved.

Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiminyu reviewed 38 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on gbrodman).

@gbrodman gbrodman force-pushed the hibernate branch 2 times, most recently from 316e074 to ac8aa74 Compare March 25, 2026 17:24
Copy link
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested in alpha just now and (after some additional fixes) and things like loading TLDs/tokens/domains work, as well as creating a token, running simple EPP commands (e.g. domain check)

think that's sufficient?

@gbrodman made 1 comment.
Reviewable status: 83 of 92 files reviewed, all discussions resolved (waiting on weiminyu).

@gbrodman gbrodman force-pushed the hibernate branch 2 times, most recently from eb22dff to ef2cc3c Compare March 25, 2026 18:41
This ended up being wayyyy more complicated than expected due to
issues with Hibernate, various dependencies having conflicts with the
proto dependency version, and other breaking changes.

Notes:
- Hibernate 7 switches up the user type / converter system and for us,
  this means we must be / want to be more explicit with how we convert
and store things. For example, we need to add Postgres types to @column
definitions.
- Hibernate 7.3 has an issue with generic MappedSuperclasses -- we have
  issues with BaseDomainLabelList. I'll investigate that, but for now
let's stick with 7.2.x
- H7 is more strict with annotations and prevents us from storing mapped
  superclasses embedded within other objects. This kinda makes sense but
makes the History objects a bit more difficult. We had to add "concrete"
embeddable DomainBase and HostBase objects that we can store/retrieve
from the DB.
- We convert some of the calls to "Query" to "TypedQuery" -- in
  Hibernate 8 / JPA 4.0 these will be super-deprecated and we'll need to
shift everything over, so this is necessary.
- You aren't supposed to put callback listeners on embedded entities
  (because it can be not obvious what's happening). We don't like that,
so we add our own annotations that are processed recursively for
embedded entities, so we get things like the update / create
timestamps.
- Hibernate doesn't allow for multiple converters to be auto-applied to
  the same "type" and it counts all VKey converters as one type.
Unfortunately, this means we have to explicitly mark each one.
- A bunch of other dependency changes were required to keep from having
  the proto 3/4 conflict
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.

3 participants