Spring JPA and persistence.xml

后端 未结 5 1794
自闭症患者
自闭症患者 2020-12-04 20:08

I\'m trying to set up a Spring JPA Hibernate simple example WAR for deployment to Glassfish. I see some examples use a persistence.xml file, and other examples do not. Some

5条回答
  •  北海茫月
    2020-12-04 20:29

    I have a test application set up using JPA/Hibernate & Spring, and my configuration mirrors yours with the exception that I create a datasource and inject it into the EntityManagerFactory, and moved the datasource specific properties out of the persistenceUnit and into the datasource. With these two small changes, my EM gets injected properly.

提交回复
热议问题