Eclipse reports error on my JPA project

前端 未结 10 1996
-上瘾入骨i
-上瘾入骨i 2021-02-04 07:39

Each time I make a JPA project Eclipse reports that there are errors in my project but I do not understand why it does so. I added image and errors below:

10条回答
  •  你的背包
    2021-02-04 08:17

    Do you have the JPA/JPA2 interfaces included in your project? If you are using maven, you need to include a dependency for the classes. I assume that they are since there are no red lines appearing in the import declarations, but just to be safe, you should validate that they exist.

    For a JPA2 dependency, you can use:

    
        org.hibernate.javax.persistence
        hibernate-jpa-2.0-api
        1.0.0.Final
    
    

提交回复
热议问题