Eclipse reports error on my JPA project

前端 未结 10 1951
-上瘾入骨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:29

    Can you try this:

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id", unique=true, nullable=false)
    private int id
    
    0 讨论(0)
  • 2021-02-04 08:29

    In my case it was just old connection in Properties->JPA->Add connection. So refresh will not help. New connection for correct database will help when refresh will not.

    0 讨论(0)
  • 2021-02-04 08:30

    I had the same problem. Here is how I solved it

    1. refreshed the connection
      • Go to Data Source Explorer
      • Select connection and right click
      • select Refresh
    2. Clean the project
      • Go t Project menu
      • select clean
    0 讨论(0)
  • 2021-02-04 08:32

    Old thread, however I just had the same problem and solved with an even quicker approach.

    1. Project Properties --> JPA
    2. Change connection to . Hit apply.
    3. Change connection to previous value. Hit apply.

    Hope this helps someone.

    0 讨论(0)
提交回复
热议问题