I am using JPA in Eclipse (Kepler) and my Entity Beans will occasionally start showing errors although nothing has changed in the class.
Suddenly the @Entity
annotation is highlighted as an error and the associated error message is:
The given name of the entity "com.test.domain.Result" is empty.
If I specifically add the name attribute (i.e. @Entity(name="somename")
then the "somename" part of the line is highlighted as an error.
Cleaning the project, restarting Eclipse does not fix this. I can copy the classes into a new project and not get the error for a while, but once it appears (with no apparent cause) I cannot get rid of it.
Any ideas what is causing it and how I can fix it please?
Update:
Well, I can find in the project properties a facility to specifically set this error to warning (or ignore!) (Project Properties -> JPA -> Errors/Warnings -> Type "Entity Name is Empty" (2nd one down in the list). Everything works fine if I do this, however I am still wondering what is causing the error in the first place.
I can find in the project properties a facility to specifically set this error to warning (or ignore!) (Project Properties -> JPA -> Errors/Warnings -> Type "Entity Name is Empty" (2nd one down in the list.
Unsetting this later actually doesn't cause the error to return, I am guessing eclipse gets out of sync with itself.
It is an issue with Eclipse JPA Validator not recognizing @ElementCollection
, if I remove this annotation all 21 errors are gone from eclipse, I removed because I do not need it anymore, have replaced it with an entity.
I have the same problem in my project. My app deploy without errors in my app server... it seems to be a validation bug. I removed JPA facet from 'Project properties -> Project facets'. You could turn off 'JPA validation' instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With