diff --git a/IX. ‘How-to’ guides/67.8. Use a traditional persistence.xml.md b/IX. ‘How-to’ guides/67.8. Use a traditional persistence.xml.md index e69de29..ac8737f 100644 --- a/IX. ‘How-to’ guides/67.8. Use a traditional persistence.xml.md +++ b/IX. ‘How-to’ guides/67.8. Use a traditional persistence.xml.md @@ -0,0 +1,5 @@ +### 67.8. 使用普通的persistence.xml + +Spring不要求使用XML配置JPA提供者(provider),并且Spring Boot假定你想要充分利用该特性。如果你倾向于使用`persistence.xml`,那你需要定义你自己的id为'entityManagerFactory'的LocalEntityManagerFactoryBean类型的`@Bean`,并在那设置持久化单元的名称。 + +默认设置可查看[JpaBaseConfiguration](https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java)