I switch from hibernate 5 to 6.4 after upgrading our application to JakartaEE.
In the current implementation we use flyway inside our application to migrate the database to the newest version. After migration, we call the new SchemaValidator(metadata… to validate the now established schema to hibernate. How I am able to do this in hibernate 6.4? The SchemaValidator is now an SPI, and I didn’t find any documentation of how the get an instance.
Thanks, Dirk
No Problem ;-). I found it myself:
Session session = entityManager.unwrap(Session.class);
SessionFactory sessionFactory = session.getSessionFactory();
sessionFactory.getSchemaManager().validateMappedObjects();