use of com.baomidou.mybatisplus.core.injector.SqlRunnerInjector in project solon by noear.
the class MybatisSqlSessionFactoryBuilderNew method build.
@Override
public SqlSessionFactory build(Configuration configuration) {
GlobalConfig globalConfig = GlobalConfigUtils.getGlobalConfig(configuration);
Object identifierGenerator;
if (null == globalConfig.getIdentifierGenerator()) {
identifierGenerator = new DefaultIdentifierGenerator();
globalConfig.setIdentifierGenerator((IdentifierGenerator) identifierGenerator);
} else {
identifierGenerator = globalConfig.getIdentifierGenerator();
}
IdWorker.setIdentifierGenerator((IdentifierGenerator) identifierGenerator);
if (globalConfig.isEnableSqlRunner()) {
(new SqlRunnerInjector()).inject(configuration);
}
SqlSessionFactory sqlSessionFactory = super.build(configuration);
globalConfig.setSqlSessionFactory(sqlSessionFactory);
Aop.getAsyn(MetaObjectHandler.class, bw -> {
globalConfig.setMetaObjectHandler(bw.get());
});
return sqlSessionFactory;
}
Aggregations