In 4.3, you should use the StandardServiceRegistryBuilder
instead.
import org.hibernate.boot.registry.StandardServiceRegistryBuilder
StandardServiceRegistryBuilder
was added as a new parent of ServiceRegistryBuilder
. The rest of the code should be the same. The only place that I have found this documented "clearly" is in the 4.3 JavaDocs for ServiceRegistryBuilder
.
One thing that I did not notice was that they changed the ServiceRegistryBuilder.buildServiceRegistry()
method to just StandardServiceRegistryBuilder.build()
. Therefore, it will require you to change that part of your building process:
new ServiceRegistryBuilder()
.applySettings(configuration.getProperties())
.buildServiceRegistry();
Becomes:
new StandardServiceRegistryBuilder()
.applySettings(configuration.getProperties())
.build();