|
|
@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
|
|
|
import org.springframework.context.annotation.DependsOn; |
|
|
|
import org.springframework.context.annotation.Profile; |
|
|
|
import org.springframework.context.annotation.Profile; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
import org.springframework.jdbc.datasource.DriverManagerDataSource; |
|
|
|
import org.springframework.jdbc.datasource.DriverManagerDataSource; |
|
|
@ -33,12 +34,14 @@ public class DatabaseConfiguration { |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@Profile("legacy") |
|
|
|
@Profile("legacy") |
|
|
|
|
|
|
|
@DependsOn("liquibase") |
|
|
|
public DaoHelper legacyDaoHelper(DataSource dataSource) { |
|
|
|
public DaoHelper legacyDaoHelper(DataSource dataSource) { |
|
|
|
return new LegacyHsqlDaoHelper(dataSource); |
|
|
|
return new LegacyHsqlDaoHelper(dataSource); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnMissingBean |
|
|
|
@ConditionalOnMissingBean |
|
|
|
|
|
|
|
@DependsOn("liquibase") |
|
|
|
public DaoHelper daoHelper(DataSource dataSource) { |
|
|
|
public DaoHelper daoHelper(DataSource dataSource) { |
|
|
|
return new GenericDaoHelper(dataSource); |
|
|
|
return new GenericDaoHelper(dataSource); |
|
|
|
} |
|
|
|
} |
|
|
|