Search in sources :

Example 6 with DatabaseConnection

use of space.npstr.sqlsauce.DatabaseConnection in project Backend by FredBoat.

the class DatabaseManager method initMainDbConn.

private DatabaseConnection initMainDbConn() throws DatabaseException {
    Flyway flyway = null;
    if (this.migrateAndValidate) {
        flyway = buildFlyway("classpath:com/fredboat/backend/quarterdeck/db/migrations/main");
    }
    DatabaseConnection databaseConnection = getBasicConnectionBuilder(MAIN_PERSISTENCE_UNIT_NAME, this.mainJdbc).setHibernateProps(buildHibernateProps("ehcache_main.xml")).addEntityPackage("com.fredboat.backend.quarterdeck.db.entities.main").setFlyway(flyway).build();
    log.debug(CacheManager.getCacheManager("MAIN_CACHEMANAGER").getActiveConfigurationText());
    return databaseConnection;
}
Also used : Flyway(org.flywaydb.core.Flyway) DatabaseConnection(space.npstr.sqlsauce.DatabaseConnection)

Aggregations

DatabaseConnection (space.npstr.sqlsauce.DatabaseConnection)6 Flyway (org.flywaydb.core.Flyway)2 Bean (org.springframework.context.annotation.Bean)2 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)2 DatabaseManager (com.fredboat.backend.quarterdeck.db.DatabaseManager)1 Nullable (javax.annotation.Nullable)1 Primary (org.springframework.context.annotation.Primary)1 JpaVendorAdapter (org.springframework.orm.jpa.JpaVendorAdapter)1 HibernateJpaVendorAdapter (org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter)1