Example usage for org.hibernate.engine.jdbc.connections.internal DatasourceConnectionProviderImpl configure

List of usage examples for org.hibernate.engine.jdbc.connections.internal DatasourceConnectionProviderImpl configure

Introduction

In this page you can find the example usage for org.hibernate.engine.jdbc.connections.internal DatasourceConnectionProviderImpl configure.

Prototype

@Override
    public void configure(Map configValues) 

Source Link

Usage

From source file:com.astonish.dropwizard.routing.hibernate.RoutingSessionFactoryFactory.java

License:Apache License

/**
 * Builds a {@link ConnectionProvider}//from  w w w.  j av  a  2 s.c o  m
 * @param dataSource
 *            the datasource
 * @param properties
 *            the connection properties
 * @return {@link ConnectionProvider}
 */
private ConnectionProvider buildConnectionProvider(DataSource dataSource, Map<String, String> properties) {
    final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
    connectionProvider.setDataSource(dataSource);
    connectionProvider.configure(properties);
    return connectionProvider;
}

From source file:com.yahoo.elide.contrib.dropwizard.elide.SessionFactoryFactory.java

License:Apache License

private ConnectionProvider buildConnectionProvider(DataSource dataSource, Map<String, String> properties) {
    final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
    connectionProvider.setDataSource(dataSource);
    connectionProvider.configure(properties);
    return connectionProvider;
}

From source file:org.opentides.persistence.hibernate.MultiTenantConnectionProviderImpl.java

License:Apache License

/**
 * This is a post construct that set ups the connection provider.
 * //  w w  w  . jav  a  2 s .  co  m
 * @throws Exception
 */
@PostConstruct
public void afterPropertiesSet() throws Exception {
    if (dataSource != null) {
        DatasourceConnectionProviderImpl ds = new DatasourceConnectionProviderImpl();
        Map<String, String> config = new HashMap<String, String>();
        ds.setDataSource(dataSource);
        ds.configure(config);
        connectionProvider = ds;
    }

    Assert.notNull(this.connectionProvider, this.getClass().getSimpleName()
            + " does not have a datasource for the database connection." + " Please check your configuration.");
}