EclipseLink JPA - location of persistence.xml

前端 未结 2 2161
感动是毒
感动是毒 2021-02-14 11:50

I am using JPA for a java class and having trouble putting the persistence XML file where it should be.

The IDE i am using is Eclipse Helios. Eclipselink jar files are d

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-14 12:54

    persistence.xml should be put inside an directory called META-INF under the root of the classpath .

    Right click your project in eclipse ==> Properties ==> Java Build Path . Suppose you configure one of the build paths to be /src/main/resources , then you should put the persistence.xml at /src/main/resources/META-INF/persistence.xml

提交回复
热议问题