Allow Data JPA's bootstrap mode to be configured via the environment

In Spring Data Lovelace, repositories' bootstrap mode can be
configured via @EnableJpaRepositories. This commit adds support for
configuring the mode via the environment rather than having to use
the annotation. Additionally, when deferred or lazy bootstrapping is
being used, the LocalContainerEntityManagerFactoryBean is configured
to use a bootstrap executor. This allows JPA's initialization to be
performed on a separate thread, allowing the rest of application
context initialization to proceed in parallel.

Closes gh-13833
This commit is contained in:
Andy Wilkinson
2018-08-14 17:07:11 +01:00
parent ab1f5931a0
commit f28528a527
11 changed files with 211 additions and 36 deletions

View File

@@ -1,3 +1,4 @@
spring.h2.console.enabled=true
spring.jpa.open-in-view=true
spring.data.jpa.repositories.bootstrap-mode=default
logging.level.org.hibernate.SQL=debug