4 thoughts on “How to get access to database table metadata with Hibernate 5

  1. Thank you for an interesting article. I am using Spring LocalContainerEntityManagerFactoryBean and among other things, a lot of hibernate.* properties are being set in a HashMap with its setJpaPropertyMap method. I tried adding MetadataExtractorIntegrator.INSTANCE as the hibernate.integrator_provider property like you do above in the JPA bootstrap configuration. Yet the Database member variable stays null. How would you go about integrating MetadataExtractorIntegrator with LocalContainerEntityManagerFactoryBean? Any other ideas on getting database metadata when using Spring and JPA/Hibernate?

    1. Actually, it’s very easy. Just use the getJPAPropertyMap and pass the Integrator from a Java-based config. It’s much easier to do it using Java configurations rather than using XML (although it’s probably doable via XML too as long as the Integrator is passed as a bean)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.