Hibernate-accessible methods and refactoring

I have some private getters/setters used only by Hibernate. I want IDEA to recognize them as used methods, so that no one is tempted to delete them as unused.

IDEA should be able to do this based on the Hibernate mapping file. Is this possible?

Joshua

4 comments
Comment actions Permalink

Joshua

>I have some private getters/setters used only by Hibernate. I want IDEA to recognize them as used methods, so that no one is tempted to delete them as unused.

>


As a workaround, you could create a separate
PATCH_FOR_IG
class, in the test source tree, where you can explicitely add calls to
all the methods that IDEA "erroneously" reports as never used.

(you should post this request in the tracker)

Alain

0
Comment actions Permalink

How to do that for private methods?

Tom

0
Comment actions Permalink

BTW, Joshua, this problem is one reason, why I abandom reflection and
reflection based frameworks.

Tom

0
Comment actions Permalink

Tom

How to do that for private methods?

>

I had missed that part of the problem.
The solution is simple: make them public, or package local, before
applying the workaround.


I often modify my production code just to make it more testable.
Sometimes, I do the same to make it more "inspectable".

Alain

0

Please sign in to leave a comment.