mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
添加日志
This commit is contained in:
parent
f861b9df9c
commit
7db13fd882
@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
@ -135,8 +136,8 @@ public class MybatisPlusJoinAutoConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private void info(String info) {
|
||||
if (properties.getBanner()) {
|
||||
private static void info(String info) {
|
||||
if (ConfigProperties.banner) {
|
||||
logger.info(info);
|
||||
}
|
||||
}
|
||||
@ -175,6 +176,16 @@ public class MybatisPlusJoinAutoConfiguration {
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
this.listableBeanFactory = beanFactory;
|
||||
SpringContentUtils.setSpringContext(this);
|
||||
|
||||
try {
|
||||
String[] names = beanFactory.getBeanNamesForType(SqlSessionFactory.class);
|
||||
for (String name : names) {
|
||||
BeanDefinition definition = beanFactory.getBeanDefinition(name);
|
||||
info(String.format("MPJ SqlSessionFactory bean definition: %s factoryBeanName: %s factoryMethodName: %s source: %s",
|
||||
name, definition.getFactoryBeanName(), definition.getFactoryMethodName(), definition.getSource()));
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class AdapterHelper {
|
||||
|
||||
static {
|
||||
String lastAdapter = "3.5.7";
|
||||
String version = Optional.of(MybatisPlusVersion.getVersion()).orElse(lastAdapter);
|
||||
String version = Optional.ofNullable(MybatisPlusVersion.getVersion()).orElse(lastAdapter);
|
||||
|
||||
if (VersionUtils.compare(version, "3.5.6") >= 0) {
|
||||
adapter = new Adapter();
|
||||
|
Loading…
x
Reference in New Issue
Block a user