Search in sources :

Example 1 with SqlOperationServiceImpl

use of io.jans.orm.sql.operation.impl.SqlOperationServiceImpl in project jans by JanssenProject.

the class SqlEntryManagerFactory method createEntryManager.

@Override
public SqlEntryManager createEntryManager(Properties conf) {
    Properties entryManagerConf = PropertiesHelper.filterProperties(conf, "#");
    SqlConnectionProvider connectionProvider = new SqlConnectionProvider(entryManagerConf);
    connectionProvider.create();
    if (!connectionProvider.isCreated()) {
        throw new ConfigurationException(String.format("Failed to create SQL connection pool! Result code: '%s'", connectionProvider.getCreationResultCode()));
    }
    LOG.debug("Created connectionProvider '{}' with code '{}'", connectionProvider, connectionProvider.getCreationResultCode());
    SqlEntryManager sqlEntryManager = new SqlEntryManager(new SqlOperationServiceImpl(entryManagerConf, connectionProvider));
    LOG.info("Created SqlEntryManager: {}", sqlEntryManager.getOperationService());
    return sqlEntryManager;
}
Also used : SqlConnectionProvider(io.jans.orm.sql.operation.impl.SqlConnectionProvider) ConfigurationException(io.jans.orm.exception.operation.ConfigurationException) SqlOperationServiceImpl(io.jans.orm.sql.operation.impl.SqlOperationServiceImpl) Properties(java.util.Properties)

Aggregations

ConfigurationException (io.jans.orm.exception.operation.ConfigurationException)1 SqlConnectionProvider (io.jans.orm.sql.operation.impl.SqlConnectionProvider)1 SqlOperationServiceImpl (io.jans.orm.sql.operation.impl.SqlOperationServiceImpl)1 Properties (java.util.Properties)1