mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
feat: optimize FlexSqlSessionFactoryBean.java
This commit is contained in:
parent
1902324018
commit
c3cd2d2b93
@ -42,7 +42,6 @@ import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
@ -91,7 +90,7 @@ import static org.springframework.util.StringUtils.tokenizeToStringArray;
|
||||
* @author life
|
||||
*/
|
||||
public class FlexSqlSessionFactoryBean extends SqlSessionFactoryBean
|
||||
implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ApplicationEvent> {
|
||||
implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SqlSessionFactoryBean.class);
|
||||
|
||||
@ -669,8 +668,8 @@ public class FlexSqlSessionFactoryBean extends SqlSessionFactoryBean
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (failFast && event instanceof ContextRefreshedEvent) {
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
if (failFast) {
|
||||
// fail-fast -> check all statements are completed
|
||||
this.sqlSessionFactory.getConfiguration().getMappedStatementNames();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user