Update 67.8. Use a traditional persistence.xml.md

master
qibaoguang 2015-04-02 13:07:47 +08:00
parent 2bc98294e7
commit 37c42e2a57
1 changed files with 5 additions and 0 deletions

View File

@ -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)