Class TopiaUtil.ConnectionProviderSupplier
java.lang.Object
org.nuiton.topia.persistence.util.TopiaUtil.ConnectionProviderSupplier
- All Implemented Interfaces:
com.google.common.base.Supplier<org.hibernate.engine.jdbc.connections.spi.ConnectionProvider>,Closeable,AutoCloseable,Supplier<org.hibernate.engine.jdbc.connections.spi.ConnectionProvider>
- Enclosing class:
- TopiaUtil
public static class TopiaUtil.ConnectionProviderSupplier
extends Object
implements com.google.common.base.Supplier<org.hibernate.engine.jdbc.connections.spi.ConnectionProvider>, Closeable
Hibernate 4.3.x compatible
Supplier<ConnectionProvider>. The provider will choose the best way to find the
ConnectionProvider depending on the way is has been created.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.hibernate.engine.jdbc.connections.spi.ConnectionProviderprotected org.hibernate.SessionFactoryIf provided, the SessionFactory will be used instead of the StandardServiceRegistryprotected org.hibernate.boot.registry.StandardServiceRegistryStandardServiceRegistry will be used if no SessionFactory is provided -
Constructor Summary
ConstructorsConstructorDescriptionConnectionProviderSupplier(org.hibernate.cfg.Configuration configuration) ConnectionProviderSupplier(TopiaHibernateSupport topiaHibernateSupport) -
Method Summary
-
Field Details
-
sessionFactory
protected org.hibernate.SessionFactory sessionFactoryIf provided, the SessionFactory will be used instead of the StandardServiceRegistry -
standardServiceRegistry
protected org.hibernate.boot.registry.StandardServiceRegistry standardServiceRegistryStandardServiceRegistry will be used if no SessionFactory is provided -
connectionProvider
protected org.hibernate.engine.jdbc.connections.spi.ConnectionProvider connectionProvider
-
-
Constructor Details
-
ConnectionProviderSupplier
-
ConnectionProviderSupplier
public ConnectionProviderSupplier(org.hibernate.cfg.Configuration configuration)
-
-
Method Details
-
get
public org.hibernate.engine.jdbc.connections.spi.ConnectionProvider get() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-