Skip to content

Commit 264e5bc

Browse files
committed
Use 'orElseThrow'
1 parent e4146e1 commit 264e5bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -280,7 +280,7 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B
280280
builder.addPropertyValue("sqlSessionTemplateBeanName",
281281
sqlSessionTemplateBeanName.orElse("sqlSessionTemplate"));
282282
} else {
283-
builder.addPropertyValue("sqlSessionFactoryBeanName", sqlSessionFactoryBeanName.get());
283+
builder.addPropertyValue("sqlSessionFactoryBeanName", sqlSessionFactoryBeanName.orElseThrow());
284284
}
285285
}
286286
builder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);

0 commit comments

Comments
 (0)