Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delegate detection of the database version to the Hibernate ORM dialect #43764

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Oct 8, 2024

  1. Add quarkus.hibernate-orm.database.version-check.enabled

    This allows disabling the check on startup if one knows the database
    won't be reachable.
    
    It also currently defaults to being disabled when a dialect is set
    explicitly (`quarkus.hibernate-orm.dialect=something`),
    in order to work around problems we have with correctly
    detecting the version on some databases that we don't have tests for
    (unsupported ones).
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    6daa2ea View commit details
    Browse the repository at this point in the history
  2. Map all relevant attributes in JPA XML mapping tests

    First because there's no reason not to (we're not testing the behavior
    for unmapped attributes), and second to work around a bug in Hibernate
    ORM 7.0 alphas/betas: https://hibernate.atlassian.net/browse/HHH-18662
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    9656d23 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    10c016d View commit details
    Browse the repository at this point in the history
  4. Make QuarkusPersistenceUnitDescriptor available to FastBootHibernateP…

    …ersistenceProvider
    
    Not strictly necessary, but doesn't hurt and might allow more changes in
    the next commits.
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    3fbd7c4 View commit details
    Browse the repository at this point in the history
  5. Disallow CDI beans impacting metadata creation

    Because:
    
    1. We currently disallow this for identifier generators only
       through a custom initializer for the identifier generator
       factory service, but that service is disappearing in Hibernate
       ORM 7.0.0.Beta1, leaving us only the setting `hibernate.cdi.extensions`.
       to disallow CDI for identifier generators -- and anything else
       that impacts metadata creation.
    2. This is needed for quarkusio#40897,
       which will move more of metadata creation to build time -- where CDI
       is just not available.
    3. Implementations of affected components needing access to CDI at
       runtime (so not during metadata creation) can still do so by
       calling `Arc.container()` to retrieve the relevant beans.
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    952dddf View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7efe64a View commit details
    Browse the repository at this point in the history
  7. Make Hibernate ORM and jdbc-derby extensions work without any other r…

    …equired dependencies
    
    With Derby moving to hibernate-community-dialects, Quarkus will need to
    add this dependency automatically.
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    cca25b7 View commit details
    Browse the repository at this point in the history
  8. Delegate detection of the database version to the Hibernate ORM dialect

    Because some dialects have very specific ways of detecting the version,
    such as running some SQL, that work better than asking the JDBC driver.
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    fb8de67 View commit details
    Browse the repository at this point in the history
  9. Re-enable detection of the database version by default when using exp…

    …licit Hibernate ORM dialects
    
    Because that detection is now done by the Hibernate ORM dialect itself,
    and should work properly for all dialects.
    yrodiere committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    9e5c1d2 View commit details
    Browse the repository at this point in the history