Example usage for org.hibernate MultiTenancyStrategy NONE

List of usage examples for org.hibernate MultiTenancyStrategy NONE

Introduction

In this page you can find the example usage for org.hibernate MultiTenancyStrategy NONE.

Prototype

MultiTenancyStrategy NONE

To view the source code for org.hibernate MultiTenancyStrategy NONE.

Click Source Link

Document

No multi-tenancy.

Usage

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);
    }
}