Java – Eclipse reports error on the JPA project

eclipsejakarta-eejavajpa

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:

enter image description here

Description Resource Path Location Type Column "id" cannot be resolved
on table "page" Page.java /BreakpointJPA/src/no/breakpoint/domain line
14 JPA Problem

Description Resource Path Location Type Column "title" cannot be
resolved on table
"page" Page.java /BreakpointJPA/src/no/breakpoint/domain line 18 JPA
Problem

Description Resource Path Location Type Primary key join column "id"
cannot be resolved on table
"page" Page.java /BreakpointJPA/src/no/breakpoint/domain line 10 JPA
Problem

enter image description here

Best Answer

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.