List of usage examples for org.hibernate MultiTenancyStrategy NONE
MultiTenancyStrategy NONE
To view the source code for org.hibernate MultiTenancyStrategy NONE.
Click Source Link
From source file:org.beangle.orm.hibernate.internal.SessionUtils.java
License:Open Source License
public static DataSource getDataSource(SessionFactory factory) { SessionFactoryImplementor factoryImpl = (SessionFactoryImplementor) factory; if (MultiTenancyStrategy.NONE == factoryImpl.getSettings().getMultiTenancyStrategy()) { return factoryImpl.getServiceRegistry().getService(ConnectionProvider.class).unwrap(DataSource.class); } else {//from w w w . ja v a2 s. c om return factoryImpl.getServiceRegistry().getService(MultiTenantConnectionProvider.class) .unwrap(DataSource.class); } }