|
@@ -1,5 +1,6 @@
|
|
|
package org.hswebframework.web.api.crud.entity;
|
|
|
|
|
|
+import org.springframework.beans.BeansException;
|
|
|
import org.springframework.context.ApplicationContextAware;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
@@ -10,7 +11,13 @@ public class EntityFactoryHolderConfiguration {
|
|
|
|
|
|
@Bean
|
|
|
public ApplicationContextAware entityFactoryHolder() {
|
|
|
- return context -> EntityFactoryHolder.FACTORY = context.getBean(EntityFactory.class);
|
|
|
+ return context -> {
|
|
|
+ try {
|
|
|
+ EntityFactoryHolder.FACTORY = context.getBean(EntityFactory.class);
|
|
|
+ } catch (BeansException ignore) {
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
}
|