public class HibernateProvider extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
configuration |
protected org.hibernate.cfg.Configuration |
hibernateConfiguration |
protected org.hibernate.SessionFactory |
hibernateSessionFactory |
protected List<Class<?>> |
persistentClasses
List of persistent classes
|
protected TopiaHibernateSessionRegistry |
sessionRegistry |
protected TopiaServiceSupport |
topiaServiceSupport |
| Constructor and Description |
|---|
HibernateProvider(Map<String,String> configuration,
TopiaServiceSupport topiaServiceSupport,
TopiaHibernateSessionRegistry sessionRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
org.hibernate.cfg.Configuration |
getHibernateConfiguration() |
protected static <S extends org.hibernate.service.Service> |
getHibernateService(org.hibernate.SessionFactory sessionFactory,
Class<S> serviceClass)
Method to get an Hibernate service instance from a given Hibernate SessionFactory
NB: This method is static to make sure it does not depend on the current instance
|
List<Class<?>> |
getPersistentClasses() |
protected String |
getProperty(String key) |
protected String |
getProperty(String key,
String defaultValue) |
org.hibernate.SessionFactory |
getSessionFactory() |
protected org.hibernate.SessionFactory hibernateSessionFactory
protected org.hibernate.cfg.Configuration hibernateConfiguration
protected TopiaServiceSupport topiaServiceSupport
protected TopiaHibernateSessionRegistry sessionRegistry
public HibernateProvider(Map<String,String> configuration, TopiaServiceSupport topiaServiceSupport, TopiaHibernateSessionRegistry sessionRegistry)
public org.hibernate.cfg.Configuration getHibernateConfiguration()
protected static <S extends org.hibernate.service.Service> S getHibernateService(org.hibernate.SessionFactory sessionFactory,
Class<S> serviceClass)
sessionFactory - the Hibernate's SessionFactory instanceserviceClass - the expected service classorg.hibernate.service.UnknownServiceException - Indicates the service was not known.ServiceRegistry.getService(Class)public void close()
public org.hibernate.SessionFactory getSessionFactory()
Copyright © 2004–2014 CodeLutin. All rights reserved.