Polish "Allow to customize the JdbcTemplate"

Closes gh-7960
This commit is contained in:
Stephane Nicoll
2017-06-01 10:48:25 +02:00
parent fa357f0e27
commit 5ea3ab4595
4 changed files with 35 additions and 30 deletions

View File

@@ -710,6 +710,11 @@ content into your application; rather pick only the properties that you need.
# JOOQ ({sc-spring-boot-autoconfigure}/jooq/JooqAutoConfiguration.{sc-ext}[JooqAutoConfiguration])
spring.jooq.sql-dialect= # Sql dialect to use, auto-detected by default.
# JDBC ({sc-spring-boot-autoconfigure}/jdbc/JdbcProperties.{sc-ext}[JdbcProperties])
spring.jdbc.template.fetch-size=-1 # Number of rows that should be fetched from the database when more rows are needed.
spring.jdbc.template.max-rows=-1 # Maximum number of rows.
spring.jdbc.template.query-timeout=-1 # Query timeout in seconds.
# JPA ({sc-spring-boot-autoconfigure}/orm/jpa/JpaBaseConfiguration.{sc-ext}[JpaBaseConfiguration], {sc-spring-boot-autoconfigure}/orm/jpa/HibernateJpaAutoConfiguration.{sc-ext}[HibernateJpaAutoConfiguration])
spring.data.jpa.repositories.enabled=true # Enable JPA repositories.
spring.jpa.database= # Target database to operate on, auto-detected by default. Can be alternatively set using the "databasePlatform" property.

View File

@@ -2932,11 +2932,20 @@ you can `@Autowire` them directly into your own beans:
}
----
You can customize some properties of the template using the `spring.jdbc.template.*`
properties:
[source,properties,indent=0]
----
spring.jdbc.template.max-rows=500
----
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]]
=== JPA and '`Spring Data`'
The Java Persistence API is a standard technology that allows you to '`map`' objects to