From 84e8a10567d11dc076b5ea57836a9f7497297e87 Mon Sep 17 00:00:00 2001
From: "fusheng.zhang" <17610759700@163.com>
Date: Wed, 5 Aug 2020 16:43:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20bean=20=E7=9A=84=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
.../jade/context/spring/SpringDataSourceFactoryDelegate.java | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index eda674d..67ee643 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
cn.zhangfusheng
paoding-rose-jade
jar
- 2.0.4
+ 2.0.5
paoding-rose-jade
diff --git a/src/main/java/net/paoding/rose/jade/context/spring/SpringDataSourceFactoryDelegate.java b/src/main/java/net/paoding/rose/jade/context/spring/SpringDataSourceFactoryDelegate.java
index 21c180d..4ba7882 100644
--- a/src/main/java/net/paoding/rose/jade/context/spring/SpringDataSourceFactoryDelegate.java
+++ b/src/main/java/net/paoding/rose/jade/context/spring/SpringDataSourceFactoryDelegate.java
@@ -36,13 +36,14 @@ public class SpringDataSourceFactoryDelegate implements DataSourceFactory {
String catlogBeanName = StringUtils.isEmpty(catalog) ? beanName : beanName + "." + catalog;
ListableBeanFactory beanFactory = this.beanFactory;
if (beanFactory != null) {
- if (beanFactory.containsBeanDefinition(catlogBeanName)) {
+ if (beanFactory.containsBeanDefinition(catlogBeanName) || beanFactory.containsBean(catlogBeanName)) {
dataSourceFactory = beanFactory.getBean(catlogBeanName, DataSourceFactory.class);
- } else if (beanFactory.containsBeanDefinition(beanName)) {
+ } else if (beanFactory.containsBeanDefinition(beanName) || beanFactory.containsBean(beanName)) {
dataSourceFactory = beanFactory.getBean(beanName, DataSourceFactory.class);
} else {
dataSourceFactory = new SpringDataSourceFactory(beanFactory);
}
+ assert dataSourceFactory != null;
dataSourceFactoryMap.put(key, dataSourceFactory);
}
}
--
GitLab