refactor all
This commit is contained in:
@@ -38,7 +38,6 @@ public class GiteaDBConfig {
|
||||
public static final String ROLLBACKER = "giteaTransactionManager";
|
||||
|
||||
@Bean(name = "giteaDataSource")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource.gitea")
|
||||
public DataSource dateSource() throws SQLException {
|
||||
HikariDataSource dataSource = new HikariDataSource();
|
||||
@@ -58,7 +57,6 @@ public class GiteaDBConfig {
|
||||
|
||||
|
||||
@Bean(name = "giteaSqlSessionFactory")
|
||||
@Primary
|
||||
public SqlSessionFactory sessionFactory(@Qualifier("giteaDataSource") DataSource datasource) throws Exception {
|
||||
org.apache.ibatis.session.Configuration config = new org.apache.ibatis.session.Configuration();
|
||||
config.setUseGeneratedKeys(true);
|
||||
@@ -69,7 +67,7 @@ public class GiteaDBConfig {
|
||||
{
|
||||
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
|
||||
List<String> mapperLocations = new ArrayList<>();
|
||||
mapperLocations.add("classpath:mapper/gitea/**/*.xml");
|
||||
// mapperLocations.add("classpath:mapper/gitea/**/*.xml");
|
||||
for (String mapperLocation : mapperLocations) {
|
||||
resources.addAll(List.of(resourceResolver.getResources(mapperLocation)));
|
||||
}
|
||||
@@ -92,7 +90,6 @@ public class GiteaDBConfig {
|
||||
|
||||
|
||||
@Bean("giteaSqlSessionTemplate")
|
||||
@Primary
|
||||
public SqlSessionTemplate sessionTemplate(@Qualifier("giteaSqlSessionFactory") SqlSessionFactory sessionfactory) {
|
||||
return new SqlSessionTemplate(sessionfactory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user