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:
Read This if you want to solve your problem easily
There is no problem in your Database. You just have to create a new connection from Eclipse to the same database which we do during Adding JPA capabilities to the Project.
Steps:-
Create a new database from your mysql prompt.
Right click on your Project in Eclipse/MyEclipse, then go to Properties.
Click on Eclipse/MyEclipse tab on the left and then click on JPA sub menu.
Then Click on Create new Connection. Put a new Connection name. And add the same Database. (You can opt to change your database too, but same database will also do).
Test Connection, and click on Finish.
First Time it wont show that newly created Connection name. Just Click Ok to close that Window.
Then, Right Click again on Project and then Click on Propeties. Now you can see your newly created Connection on that Connection drop down list. Selct that and Click OK.
Your Error will vanish.
Possible Reason for this error:-
Eclipse creates connection with you database everytime you connect using any project using persistence.xml, but only for the first time.
So, any changes after that, especially from the database side(table name etc.) will throw an error from Eclipse.
Thank You.