Spring JPA and persistence.xml

后端 未结 5 1804
自闭症患者
自闭症患者 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:26

    This may be old, but if anyone has the same problem try changing unitname to just name in the PersistenceContext annotation:

    From

    @PersistenceContext(unitName="educationPU")
    

    to

    @PersistenceContext(name="educationPU")
    

提交回复
热议问题