Reuse JdbcTemplate in NamedParameterJdbcTemplate
This commit makes sure to reuse an existing or auto-configured `JdbcTemplate` when auto-configuring a `NamedParameterJdbcTemplate`. This ensures that whatever customizations have been applied on the `JdbcTemplate` are properly shared. Closes gh-4945
This commit is contained in:
@@ -2932,6 +2932,9 @@ you can `@Autowire` them directly into your own beans:
|
||||
}
|
||||
----
|
||||
|
||||
TIP: The `NamedParameterJdbcTemplate` reuses the same `JdbcTemplate` instance behind the
|
||||
scene. If more than one `JdbcTemplate` is defined and no primary candidate exists, the
|
||||
`NamedParameterJdbcTemplate` is not auto-configured.
|
||||
|
||||
|
||||
[[boot-features-jpa-and-spring-data]]
|
||||
|
||||
Reference in New Issue
Block a user