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
请先登录再写评论。
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
How to do that for private methods?
Tom
BTW, Joshua, this problem is one reason, why I abandom reflection and
reflection based frameworks.
Tom
Tom
>
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