1
0
mirror of https://github.com/google/nomulus synced 2026-07-23 08:22:27 +00:00

Update Hibernate and various other dependencies (#2986)

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
This commit is contained in:
gbrodman
2026-03-25 16:10:50 -04:00
committed by GitHub
parent 8c9b38e6af
commit 59b44b60df
91 changed files with 1663 additions and 3588 deletions
@@ -27,12 +27,12 @@
domain_name text,
redemption_domain_repo_id text,
redemption_domain_history_id bigint,
registration_behavior text not null check (registration_behavior in ('DEFAULT','BYPASS_TLD_STATE','ANCHOR_TENANT','NONPREMIUM_CREATE')),
registration_behavior text not null check ((registration_behavior in ('DEFAULT','BYPASS_TLD_STATE','ANCHOR_TENANT','NONPREMIUM_CREATE'))),
renewal_price_amount numeric(19,2),
renewal_price_currency text,
renewal_price_behavior text not null check (renewal_price_behavior in ('DEFAULT','NONPREMIUM','SPECIFIED')),
renewal_price_behavior text not null check ((renewal_price_behavior in ('DEFAULT','NONPREMIUM','SPECIFIED'))),
token_status_transitions hstore,
token_type text check (token_type in ('BULK_PRICING','DEFAULT_PROMO','PACKAGE','SINGLE_USE','UNLIMITED_USE','REGISTER_BSA')),
token_type text check ((token_type in ('BULK_PRICING','DEFAULT_PROMO','PACKAGE','SINGLE_USE','UNLIMITED_USE','REGISTER_BSA'))),
constraint allocation_token_token_idx primary key (token)
);
@@ -43,7 +43,7 @@
domain_repo_id text not null,
event_time timestamp(6) with time zone not null,
flags text[],
reason text not null check (reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER')),
reason text not null check ((reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER'))),
domain_name text not null,
billing_event_id bigint,
billing_recurrence_id bigint,
@@ -58,7 +58,7 @@
domain_repo_id text not null,
event_time timestamp(6) with time zone not null,
flags text[],
reason text not null check (reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER')),
reason text not null check ((reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER'))),
domain_name text not null,
allocation_token text,
billing_time timestamp(6) with time zone,
@@ -78,21 +78,21 @@
domain_repo_id text not null,
event_time timestamp(6) with time zone not null,
flags text[],
reason text not null check (reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER')),
reason text not null check ((reason in ('CREATE','ERROR','FEE_EARLY_ACCESS','RENEW','RESTORE','SERVER_STATUS','TRANSFER'))),
domain_name text not null,
recurrence_end_time timestamp(6) with time zone,
recurrence_last_expansion timestamp(6) with time zone not null,
recurrence_time_of_year text,
renewal_price_amount numeric(19,2),
renewal_price_currency text,
renewal_price_behavior text not null check (renewal_price_behavior in ('DEFAULT','NONPREMIUM','SPECIFIED')),
renewal_price_behavior text not null check ((renewal_price_behavior in ('DEFAULT','NONPREMIUM','SPECIFIED'))),
primary key (billing_recurrence_id)
);
create table "BsaDomainRefresh" (
job_id bigint generated by default as identity,
creation_time timestamp(6) with time zone not null,
stage text not null check (stage in ('CHECK_FOR_CHANGES','APPLY_CHANGES','UPLOAD_REMOVALS','UPLOAD_ADDITIONS','DONE')),
stage text not null check ((stage in ('CHECK_FOR_CHANGES','APPLY_CHANGES','UPLOAD_REMOVALS','UPLOAD_ADDITIONS','DONE'))),
update_timestamp timestamp(6) with time zone,
primary key (job_id)
);
@@ -101,7 +101,7 @@
job_id bigint generated by default as identity,
block_list_checksums text not null,
creation_time timestamp(6) with time zone not null,
stage text not null check (stage in ('DOWNLOAD_BLOCK_LISTS','MAKE_ORDER_AND_LABEL_DIFF','APPLY_ORDER_AND_LABEL_DIFF','REPORT_START_OF_ORDER_PROCESSING','UPLOAD_UNBLOCKABLE_DOMAINS_FOR_NEW_ORDERS','REPORT_END_OF_ORDER_PROCESSING','DONE','NOP','CHECKSUMS_DO_NOT_MATCH')),
stage text not null check ((stage in ('DOWNLOAD_BLOCK_LISTS','MAKE_ORDER_AND_LABEL_DIFF','APPLY_ORDER_AND_LABEL_DIFF','REPORT_START_OF_ORDER_PROCESSING','UPLOAD_UNBLOCKABLE_DOMAINS_FOR_NEW_ORDERS','REPORT_END_OF_ORDER_PROCESSING','DONE','NOP','CHECKSUMS_DO_NOT_MATCH'))),
update_timestamp timestamp(6) with time zone,
primary key (job_id)
);
@@ -116,13 +116,13 @@
label text not null,
tld text not null,
creation_time timestamp(6) with time zone not null,
reason text not null check (reason in ('REGISTERED','RESERVED')),
reason text not null check ((reason in ('REGISTERED','RESERVED'))),
primary key (label, tld)
);
create table "ClaimsEntry" (
revision_id bigint not null,
domain_label text not null,
revision_id bigint not null,
claim_key text not null,
primary key (domain_label, revision_id)
);
@@ -139,7 +139,7 @@
description text,
method text not null,
modification_time timestamp(6) with time zone not null,
type text not null check (type in ('DUM_DOWNLOAD','DOMAIN_DELETE','DOMAIN_SUSPEND','DOMAIN_UNSUSPEND','EPP_PASSWORD_UPDATE','REGISTRAR_CREATE','REGISTRAR_CONTACTS_UPDATE','REGISTRAR_SECURITY_UPDATE','REGISTRAR_UPDATE','REGISTRY_LOCK','REGISTRY_UNLOCK','USER_CREATE','USER_DELETE','USER_UPDATE')),
type text not null check ((type in ('DUM_DOWNLOAD','DOMAIN_DELETE','DOMAIN_SUSPEND','DOMAIN_UNSUSPEND','EPP_PASSWORD_UPDATE','REGISTRAR_CREATE','REGISTRAR_CONTACTS_UPDATE','REGISTRAR_SECURITY_UPDATE','REGISTRAR_UPDATE','REGISTRY_LOCK','REGISTRY_UNLOCK','USER_CREATE','USER_DELETE','USER_UPDATE'))),
url text not null,
acting_user text not null,
primary key (revision_id)
@@ -147,7 +147,7 @@
create table "Cursor" (
scope text not null,
type text not null check (type in ('BRDA','RDE_REPORT','RDE_STAGING','RDE_UPLOAD','RDE_UPLOAD_SFTP','RECURRING_BILLING','SYNC_REGISTRAR_SHEET','ICANN_UPLOAD_TX','ICANN_UPLOAD_ACTIVITY')),
type text not null check ((type in ('BRDA','RDE_REPORT','RDE_STAGING','RDE_UPLOAD','RDE_UPLOAD_SFTP','RECURRING_BILLING','SYNC_REGISTRAR_SHEET','ICANN_UPLOAD_TX','ICANN_UPLOAD_ACTIVITY'))),
last_update_time timestamp(6) with time zone not null,
cursor_time timestamp(6) with time zone not null,
primary key (scope, type)
@@ -168,7 +168,7 @@
name text not null,
request_time timestamp(6) with time zone not null,
tld text not null,
type text not null check (type in ('DOMAIN','HOST')),
type text not null check ((type in ('DOMAIN','HOST'))),
primary key (id)
);
@@ -198,7 +198,7 @@
launch_notice_expiration_time timestamp(6) with time zone,
launch_notice_tcn_id text,
launch_notice_validator_id text,
lordn_phase text check (lordn_phase in ('SUNRISE','CLAIMS','NONE')),
lordn_phase text check ((lordn_phase in ('SUNRISE','CLAIMS','NONE'))),
registrant_contact text,
registration_expiration_time timestamp(6) with time zone,
smd_id text,
@@ -215,7 +215,7 @@
transfer_autorenew_poll_message_id bigint,
transfer_autorenew_poll_message_history_id bigint,
transfer_billing_event_id bigint,
transfer_renew_period_unit text check (transfer_renew_period_unit in ('YEARS','MONTHS')),
transfer_renew_period_unit text check ((transfer_renew_period_unit in ('YEARS','MONTHS'))),
transfer_renew_period_value integer,
transfer_client_txn_id text,
transfer_server_txn_id text,
@@ -224,7 +224,7 @@
transfer_losing_registrar_id text,
transfer_pending_expiration_time timestamp(6) with time zone,
transfer_request_time timestamp(6) with time zone,
transfer_status text check (transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED')),
transfer_status text check ((transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED'))),
primary key (repo_id)
);
@@ -249,10 +249,10 @@
history_requested_by_registrar boolean,
history_client_transaction_id text,
history_server_transaction_id text,
history_type text not null check (history_type in ('CONTACT_CREATE','CONTACT_DELETE','CONTACT_DELETE_FAILURE','CONTACT_PENDING_DELETE','CONTACT_TRANSFER_APPROVE','CONTACT_TRANSFER_CANCEL','CONTACT_TRANSFER_REJECT','CONTACT_TRANSFER_REQUEST','CONTACT_UPDATE','DOMAIN_ALLOCATE','DOMAIN_AUTORENEW','DOMAIN_CREATE','DOMAIN_DELETE','DOMAIN_RENEW','DOMAIN_RESTORE','DOMAIN_TRANSFER_APPROVE','DOMAIN_TRANSFER_CANCEL','DOMAIN_TRANSFER_REJECT','DOMAIN_TRANSFER_REQUEST','DOMAIN_UPDATE','HOST_CREATE','HOST_DELETE','HOST_DELETE_FAILURE','HOST_PENDING_DELETE','HOST_UPDATE','RDE_IMPORT','SYNTHETIC')),
history_type text not null check ((history_type in ('CONTACT_CREATE','CONTACT_DELETE','CONTACT_DELETE_FAILURE','CONTACT_PENDING_DELETE','CONTACT_TRANSFER_APPROVE','CONTACT_TRANSFER_CANCEL','CONTACT_TRANSFER_REJECT','CONTACT_TRANSFER_REQUEST','CONTACT_UPDATE','DOMAIN_ALLOCATE','DOMAIN_AUTORENEW','DOMAIN_CREATE','DOMAIN_DELETE','DOMAIN_RENEW','DOMAIN_RESTORE','DOMAIN_TRANSFER_APPROVE','DOMAIN_TRANSFER_CANCEL','DOMAIN_TRANSFER_REJECT','DOMAIN_TRANSFER_REQUEST','DOMAIN_UPDATE','HOST_CREATE','HOST_DELETE','HOST_DELETE_FAILURE','HOST_PENDING_DELETE','HOST_UPDATE','RDE_IMPORT','SYNTHETIC'))),
history_xml_bytes bytea,
history_other_registrar_id text,
history_period_unit text check (history_period_unit in ('YEARS','MONTHS')),
history_period_unit text check ((history_period_unit in ('YEARS','MONTHS'))),
history_period_value integer,
admin_contact text,
auth_info_repo_id text,
@@ -270,7 +270,7 @@
launch_notice_expiration_time timestamp(6) with time zone,
launch_notice_tcn_id text,
launch_notice_validator_id text,
lordn_phase text check (lordn_phase in ('SUNRISE','CLAIMS','NONE')),
lordn_phase text check ((lordn_phase in ('SUNRISE','CLAIMS','NONE'))),
registrant_contact text,
registration_expiration_time timestamp(6) with time zone,
smd_id text,
@@ -287,7 +287,7 @@
transfer_autorenew_poll_message_id bigint,
transfer_autorenew_poll_message_history_id bigint,
transfer_billing_event_id bigint,
transfer_renew_period_unit text check (transfer_renew_period_unit in ('YEARS','MONTHS')),
transfer_renew_period_unit text check ((transfer_renew_period_unit in ('YEARS','MONTHS'))),
transfer_renew_period_value integer,
transfer_client_txn_id text,
transfer_server_txn_id text,
@@ -296,7 +296,7 @@
transfer_losing_registrar_id text,
transfer_pending_expiration_time timestamp(6) with time zone,
transfer_request_time timestamp(6) with time zone,
transfer_status text check (transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED')),
transfer_status text check ((transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED'))),
creation_registrar_id text,
creation_time timestamp(6) with time zone,
current_sponsor_registrar_id text,
@@ -326,14 +326,14 @@
domain_repo_id text,
history_revision_id bigint,
report_amount integer not null,
report_field text not null check (report_field in ('NET_ADDS_1_YR','NET_ADDS_2_YR','NET_ADDS_3_YR','NET_ADDS_4_YR','NET_ADDS_5_YR','NET_ADDS_6_YR','NET_ADDS_7_YR','NET_ADDS_8_YR','NET_ADDS_9_YR','NET_ADDS_10_YR','NET_RENEWS_1_YR','NET_RENEWS_2_YR','NET_RENEWS_3_YR','NET_RENEWS_4_YR','NET_RENEWS_5_YR','NET_RENEWS_6_YR','NET_RENEWS_7_YR','NET_RENEWS_8_YR','NET_RENEWS_9_YR','NET_RENEWS_10_YR','TRANSFER_SUCCESSFUL','TRANSFER_NACKED','DELETED_DOMAINS_GRACE','DELETED_DOMAINS_NOGRACE','RESTORED_DOMAINS')),
report_field text not null check ((report_field in ('NET_ADDS_1_YR','NET_ADDS_2_YR','NET_ADDS_3_YR','NET_ADDS_4_YR','NET_ADDS_5_YR','NET_ADDS_6_YR','NET_ADDS_7_YR','NET_ADDS_8_YR','NET_ADDS_9_YR','NET_ADDS_10_YR','NET_RENEWS_1_YR','NET_RENEWS_2_YR','NET_RENEWS_3_YR','NET_RENEWS_4_YR','NET_RENEWS_5_YR','NET_RENEWS_6_YR','NET_RENEWS_7_YR','NET_RENEWS_8_YR','NET_RENEWS_9_YR','NET_RENEWS_10_YR','TRANSFER_SUCCESSFUL','TRANSFER_NACKED','DELETED_DOMAINS_GRACE','DELETED_DOMAINS_NOGRACE','RESTORED_DOMAINS'))),
reporting_time timestamp(6) with time zone not null,
tld text not null,
primary key (id)
);
create table "FeatureFlag" (
feature_name text not null check (feature_name in ('TEST_FEATURE','FEE_EXTENSION_1_DOT_0_IN_PROD','MINIMUM_DATASET_CONTACTS_OPTIONAL','MINIMUM_DATASET_CONTACTS_PROHIBITED','INCLUDE_PENDING_DELETE_DATE_FOR_DOMAINS','PROHIBIT_CONTACT_OBJECTS_ON_LOGIN')),
feature_name text not null check ((feature_name in ('TEST_FEATURE','FEE_EXTENSION_1_DOT_0_IN_PROD','MINIMUM_DATASET_CONTACTS_OPTIONAL','MINIMUM_DATASET_CONTACTS_PROHIBITED','INCLUDE_PENDING_DELETE_DATE_FOR_DOMAINS','PROHIBIT_CONTACT_OBJECTS_ON_LOGIN'))),
status hstore not null,
primary key (feature_name)
);
@@ -345,7 +345,7 @@
registrar_id text not null,
domain_repo_id text not null,
expiration_time timestamp(6) with time zone not null,
type text not null check (type in ('ADD','AUTO_RENEW','REDEMPTION','RENEW','PENDING_DELETE','PENDING_RESTORE','TRANSFER')),
type text not null check ((type in ('ADD','AUTO_RENEW','REDEMPTION','RENEW','PENDING_DELETE','PENDING_RESTORE','TRANSFER'))),
primary key (grace_period_id)
);
@@ -356,7 +356,7 @@
registrar_id text not null,
domain_repo_id text not null,
expiration_time timestamp(6) with time zone not null,
type text not null check (type in ('ADD','AUTO_RENEW','REDEMPTION','RENEW','PENDING_DELETE','PENDING_RESTORE','TRANSFER')),
type text not null check ((type in ('ADD','AUTO_RENEW','REDEMPTION','RENEW','PENDING_DELETE','PENDING_RESTORE','TRANSFER'))),
domain_history_revision_id bigint,
grace_period_id bigint not null,
primary key (grace_period_history_revision_id)
@@ -390,7 +390,7 @@
history_requested_by_registrar boolean,
history_client_transaction_id text,
history_server_transaction_id text,
history_type text not null check (history_type in ('CONTACT_CREATE','CONTACT_DELETE','CONTACT_DELETE_FAILURE','CONTACT_PENDING_DELETE','CONTACT_TRANSFER_APPROVE','CONTACT_TRANSFER_CANCEL','CONTACT_TRANSFER_REJECT','CONTACT_TRANSFER_REQUEST','CONTACT_UPDATE','DOMAIN_ALLOCATE','DOMAIN_AUTORENEW','DOMAIN_CREATE','DOMAIN_DELETE','DOMAIN_RENEW','DOMAIN_RESTORE','DOMAIN_TRANSFER_APPROVE','DOMAIN_TRANSFER_CANCEL','DOMAIN_TRANSFER_REJECT','DOMAIN_TRANSFER_REQUEST','DOMAIN_UPDATE','HOST_CREATE','HOST_DELETE','HOST_DELETE_FAILURE','HOST_PENDING_DELETE','HOST_UPDATE','RDE_IMPORT','SYNTHETIC')),
history_type text not null check ((history_type in ('CONTACT_CREATE','CONTACT_DELETE','CONTACT_DELETE_FAILURE','CONTACT_PENDING_DELETE','CONTACT_TRANSFER_APPROVE','CONTACT_TRANSFER_CANCEL','CONTACT_TRANSFER_REJECT','CONTACT_TRANSFER_REQUEST','CONTACT_UPDATE','DOMAIN_ALLOCATE','DOMAIN_AUTORENEW','DOMAIN_CREATE','DOMAIN_DELETE','DOMAIN_RENEW','DOMAIN_RESTORE','DOMAIN_TRANSFER_APPROVE','DOMAIN_TRANSFER_CANCEL','DOMAIN_TRANSFER_REJECT','DOMAIN_TRANSFER_REQUEST','DOMAIN_UPDATE','HOST_CREATE','HOST_DELETE','HOST_DELETE_FAILURE','HOST_PENDING_DELETE','HOST_UPDATE','RDE_IMPORT','SYNTHETIC'))),
history_xml_bytes bytea,
host_name text,
inet_addresses text[],
@@ -435,12 +435,12 @@
registrar_id text not null,
request_time timestamp(6) with time zone not null,
requester text not null,
type text not null check (type in ('EPP','REGISTRY_LOCK')),
type text not null check ((type in ('EPP','REGISTRY_LOCK'))),
primary key (verification_code)
);
create table "PollMessage" (
type text not null,
type text not null check ((type in ('ONE_TIME','AUTORENEW'))),
poll_message_id bigint not null,
registrar_id text not null,
contact_history_revision_id bigint,
@@ -464,15 +464,15 @@
transfer_response_losing_registrar_id text,
transfer_response_pending_transfer_expiration_time timestamp(6) with time zone,
transfer_response_transfer_request_time timestamp(6) with time zone,
transfer_response_transfer_status text check (transfer_response_transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED')),
transfer_response_transfer_status text check ((transfer_response_transfer_status in ('CLIENT_APPROVED','CLIENT_CANCELLED','CLIENT_REJECTED','PENDING','SERVER_APPROVED','SERVER_CANCELLED'))),
autorenew_end_time timestamp(6) with time zone,
autorenew_domain_name text,
primary key (poll_message_id)
);
create table "PremiumEntry" (
revision_id bigint not null,
domain_label text not null,
revision_id bigint not null,
price numeric(19,2) not null,
primary key (domain_label, revision_id)
);
@@ -488,7 +488,7 @@
create table "RdeRevision" (
date date not null,
mode text not null check (mode in ('FULL','THIN')),
mode text not null check ((mode in ('FULL','THIN'))),
tld text not null,
update_timestamp timestamp(6) with time zone,
revision integer not null,
@@ -539,8 +539,8 @@
registrar_name text not null,
registry_lock_allowed boolean not null,
password_salt text,
state text check (state in ('PENDING','ACTIVE','SUSPENDED','DISABLED')),
type text not null check (type in ('REAL','OTE','PDT','EXTERNAL_MONITORING','INTERNAL','MONITORING','TEST')),
state text check ((state in ('PENDING','ACTIVE','SUSPENDED','DISABLED'))),
type text not null check ((type in ('REAL','OTE','PDT','EXTERNAL_MONITORING','INTERNAL','MONITORING','TEST'))),
url text,
whois_server text,
primary key (registrar_id)
@@ -580,10 +580,10 @@
);
create table "ReservedEntry" (
revision_id bigint not null,
domain_label text not null,
revision_id bigint not null,
comment text,
reservation_type integer not null check (reservation_type between 0 and 4),
reservation_type integer not null check ((reservation_type between 0 and 4)),
primary key (domain_label, revision_id)
);
@@ -665,7 +665,7 @@
server_status_change_billing_cost_amount numeric(19,2),
server_status_change_billing_cost_currency text,
tld_state_transitions hstore not null,
tld_type text not null check (tld_type in ('REAL','TEST')),
tld_type text not null check ((tld_type in ('REAL','TEST'))),
tld_unicode text not null,
transfer_grace_period_length interval not null,
primary key (tld_name)
@@ -685,7 +685,7 @@
registry_lock_email_address text,
registry_lock_password_hash text,
registry_lock_password_salt text,
global_role text not null check (global_role in ('NONE','SUPPORT_AGENT','SUPPORT_LEAD','FTE')),
global_role text not null check ((global_role in ('NONE','SUPPORT_AGENT','SUPPORT_LEAD','FTE'))),
is_admin boolean not null,
registrar_roles hstore,
primary key (email_address)