Diferencia entre revisiones de «Usuario:Lmorillas/desarrollo web servidor/jee/intro hibernate»
De WikiEducator
(→BuildSessionFactory) |
|||
Línea 32: | Línea 32: | ||
.configure(); | .configure(); | ||
− | serviceRegistry = new ServiceRegistryBuilder() | + | ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() |
.applySettings(hibConfiguration.getProperties()) | .applySettings(hibConfiguration.getProperties()) | ||
.buildServiceRegistry(); | .buildServiceRegistry(); |
Revisión de 23:06 30 ene 2013
Objetivos
Tareas
Guión
|
BuildSessionFactory
Configuration hibConfiguration = new Configuration() .addResource("wp4core/hibernate/config/table.hbm.xml") .configure(); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() .applySettings(hibConfiguration.getProperties()) .buildServiceRegistry(); sessionFactory = hibConfiguration.buildSessionFactory(serviceRegistry); session = sessionFactory.withOptions().openSession();