Commit 95dac0bb authored by Stephane Nicoll's avatar Stephane Nicoll

Polish documentation

Improve the documentation on using two entity managers if Spring Data is
used.

Closes gh-3433
parent bae3dcba
...@@ -1440,6 +1440,27 @@ be picked up by the default `JpaTransactionManager` in Spring Boot if you mark i ...@@ -1440,6 +1440,27 @@ be picked up by the default `JpaTransactionManager` in Spring Boot if you mark i
`@Primary`. The other would have to be explicitly injected into a new instance. Or you `@Primary`. The other would have to be explicitly injected into a new instance. Or you
might be able to use a JTA transaction manager spanning both. might be able to use a JTA transaction manager spanning both.
If you are using Spring Data, you need to configure `@EnableJpaRepositories` accordingly:
[source,java,indent=0,subs="verbatim,quotes,attributes"]
----
@Configuration
@EnableJpaRepositories(basePackageClasses = Customer.class,
entityManagerFactoryRef = "customerEntityManagerFactory")
public class CustomerConfiguration {
...
}
@Configuration
@EnableJpaRepositories(basePackageClasses = Order.class,
entityManagerFactoryRef = "orderEntityManagerFactory")
public class OrderConfiguration {
...
}
----
[[howto-use-traditional-persistence-xml]] [[howto-use-traditional-persistence-xml]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment