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

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
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