# Calling SchemaValidator validate inside application

**URL:** https://discourse.hibernate.org/t/calling-schemavalidator-validate-inside-application/8685
**Category:** Hibernate ORM
**Created:** [December 10, 2023, 7:23pm UTC](https://discourse.hibernate.org/t/calling-schemavalidator-validate-inside-application/8685 "2023-12-10T19:23:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dirkey](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/dirkey/32/2858_2.png) [@Dirkey](https://discourse.hibernate.org/u/Dirkey)
#### Post date: [December 10, 2023, 7:23pm UTC](https://discourse.hibernate.org/t/calling-schemavalidator-validate-inside-application/8685/1 "2023-12-10T19:23:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Dirkey](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/dirkey/32/2858_2.png) [@Dirkey](https://discourse.hibernate.org/u/Dirkey)
#### Post date: [December 10, 2023, 7:49pm UTC](https://discourse.hibernate.org/t/calling-schemavalidator-validate-inside-application/8685/2 "2023-12-10T19:49:34Z")

</div>

No Problem ;-). I found it myself:

```auto
            Session session = entityManager.unwrap(Session.class);
            SessionFactory sessionFactory = session.getSessionFactory();
            sessionFactory.getSchemaManager().validateMappedObjects();

```
