Where did Configuration.generateSchemaCreationScript() go in Hibernate 5

Thanks to the answers by Vlad and Gunnar, I’ve managed to find my way through the new configuration API to produce the equivalent export logic with the following. Of course, history shows that this API will break again, so make sure to choose the appropriate version: Hibernate 5.2: MetadataSources metadata = new MetadataSources( new StandardServiceRegistryBuilder() … Read more

spring – hibernate 5 naming strategy configuration

I think I found the solution. To achieve my goal, I used hibernate.physical_naming_strategy configuration, instead of hibernate.implicit_naming_strategy. I created an implementation of the PhysicalNamingStrategy interface which simulates part of the functionality of the original ImprovedNamingStrategy class: package fms.util.hibernate; import org.apache.commons.lang.StringUtils; import org.hibernate.boot.model.naming.Identifier; import org.hibernate.boot.model.naming.PhysicalNamingStrategy; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; public class ImprovedNamingStrategy implements PhysicalNamingStrategy { @Override public Identifier … Read more

ImprovedNamingStrategy no longer working in Hibernate 5

Thanks for posting your own solution. It helps me so much to set Hibernate 5 naming strategy! The hibernate.ejb.naming_strategy property of pre-Hibernate 5.0 seems split into two parts: hibernate.physical_naming_strategy hibernate.implicit_naming_strategy The values of these properties do not implement the NamingStrategy interface as did hibernate.ejb.naming_strategy. There are two new interfaces for these purposes: org.hibernate.boot.model.naming.PhysicalNamingStrategy org.hibernate.boot.model.naming.ImplicitNamingStrategy Hibernate … Read more

Hibernate 5 :- org.hibernate.MappingException: Unknown entity

I have fixed the same issue with Hibernate 5. There is a problem in this code Configuration configuration = new Configuration(); configuration.configure(); ServiceRegistry sr = new StandardServiceRegistryBuilder().applySettings( configuration.getProperties()).build(); SessionFactory sf = configuration.buildSessionFactory(sr); This code works fine for Hibernate 4.3.5, but the same code has the same issue for Hibernate 5. When you do configuration.buildSessionFactory(sr), using … Read more