|
|
@@ -1,5 +1,6 @@
|
|
|
package com.tsi.api.server.mybatis;
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
|
|
import org.mybatis.spring.SqlSessionTemplate;
|
|
|
@@ -18,15 +19,23 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Configuration
|
|
|
@EnableTransactionManagement
|
|
|
public class MybatisConfig {
|
|
|
|
|
|
@Value("${spring.datasource.hikari.mapper-locations:classpath:mybatis/mapper/**/*.xml}")
|
|
|
String mapperLocations;
|
|
|
+ @Value("${spring.datasource.hikari.jdbc-url}")
|
|
|
+ String jdbcUrl;
|
|
|
|
|
|
@PostConstruct
|
|
|
private void init() {
|
|
|
+ if (this.mapperLocations.trim().isEmpty()) {
|
|
|
+ this.mapperLocations = "classpath:mybatis/mapper/**/*.xml";
|
|
|
+ }
|
|
|
+ log.info(" jdbcUrl: {}", this.jdbcUrl);
|
|
|
+ log.info("mapperLocations: {}", this.mapperLocations);
|
|
|
}
|
|
|
|
|
|
@Primary
|