Skip to content

Commit 04ba412

Browse files
committed
Document need for JdbcDialect bean with Sring Data JDBC and AOT
Closes gh-48240
1 parent a39adff commit 04ba412

File tree

1 file changed

+4
-0
lines changed
  • documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/data

1 file changed

+4
-0
lines changed

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/data/sql.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ Spring Boot will auto-configure Spring Data's JDBC repositories when the necessa
331331
They can be added to your project with a single dependency on `spring-boot-starter-data-jdbc`.
332332
If necessary, you can take control of Spring Data JDBC's configuration by adding the javadoc:org.springframework.data.jdbc.repository.config.EnableJdbcRepositories[format=annotation] annotation or an javadoc:org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration[] subclass to your application.
333333

334+
If you're using Spring Data JDBC with xref:packaging/aot.adoc[ahead-of-time processing] (targetting either the JVM or a native image), some additional configuration is recommended.
335+
To prevent the need for a DB connection during AOT processing, define a `JdbcDialect` bean that's appropriate for your application's database.
336+
For example, if you're using Postgres, define a `JdbcPostgresDialect` bean.
337+
334338
TIP: For complete details of Spring Data JDBC, see the {url-spring-data-jdbc-docs}[reference documentation].
335339

336340

0 commit comments

Comments
 (0)