Using Hibernate 3.x with JPA annoatations.
We want to restrict visibility for some @Entity setters, declaring them with private or package level accessibility.
IDEA marks the setters as unused.
However, they are used by Hibernate. When the entity is loaded, Hibernate will initialize the entity using the (restricted scope) setters.
It would be better if setters referring to a persistent property of an entity were excluded from usage checks.
If the entity uses annotations on the fields then the setters are indeed unused.