I created an entity class with int @Id field (property exactly so I put annotation before "get" methods). It worked fine. Then, I thought that for my project it would be better to have an Integer Primry Key property instead of int and I tried to change it. And now I see that this causes a problem.
Changing field type goes well. But changing returning type in "get" method (into Integer) or changing internal parameter (explicit) in "set" method causes that my Eclipse
IDE can't recognize primary key field. I get warning mark at @Entity annotation with tip "The entity has no primary key attribute defined"
Code looks like this:
If I remove Integer types from methods the Eclipse warning disappears.
But during deployment server throws Exceptions for that JPA entity class.
What is wrong with taht Integer type?
I can't find in documentation statement that Integer can't be used for primary key field.