最后更新于5年前
这有帮助吗?
Spring不要求使用XML配置JPA提供者(provider),并且Spring Boot假定你想要充分利用该特性。如果你倾向于使用persistence.xml,那你需要定义你自己的ID为entityManagerFactory的LocalEntityManagerFactoryBean类型的@Bean,并在那设置持久化单元的名称,默认设置可查看。
persistence.xml
entityManagerFactory
LocalEntityManagerFactoryBean
@Bean