Eclipse reports error on my JPA project

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

    I've had the same problem, the solution for me was to refresh the database connection.

    Open the JPA view, find the data source explorer. There you open Database Connection, connect with your database, hit refresh. Then make some changes in your file and save it, i added an @Column(name = "") annotation to my id field. After that the error message was gone, and i ereased the Column annotation.

    The Problem seems to be that eclipse reads the database tables after establishing the first connection, after that the connection is closed. So if you, like i did, made some changes after this first connection in your database, like changing the field name from foo_id to just id, eclipse didn't know that and comes with this error.

提交回复
热议问题