Skip to content

Add option to ignore specific fields during Hibernate ORM validation in dev mode #49450

@gbourant

Description

@gbourant

Description

When quarkus.hibernate-orm.validate-in-dev-mode is enabled, the validation process generates SQL suggestions for schema changes, such as altering column data types. In some cases, these suggestions are unnecessary or unwanted for certain fields, leading to noisy error logs.

ERROR [io.qua.hib.orm.run.sch.SchemaManagementIntegrator] (Hibernate post-boot validation thread for <default>) The following SQL may resolve the database issues, as generated by the Hibernate schema migration tool. WARNING: You must manually verify this SQL is correct, this is a best effort guess, do not copy/paste it without verifying that it does what you expect.

    alter table if exists Mail 
       alter column BCC set data type varchar(255);

    alter table if exists Mail 
       alter column BOUNCE_ADDRESS set data type varchar(255);

    alter table if exists Mail 
       alter column CC set data type varchar(255);

It would be helpful to have a configuration option (e.g., a property like quarkus.hibernate-orm.validation.ignore-fields) that allows users to specify a list of columns to ignore during validation. This could be formatted as a comma-separated list of fully qualified field names.

quarkus.hibernate-orm.validation.ignore-fields=Mail.BCC,Mail.BOUNCE_ADDRESS,Mail.CC

Implementation ideas

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions