As you know, Spring can inject values to private instance variables, and Hibernate can access private variables of persistent classes. However, I can’t even call protected methods of a class through reflection! How can Spring and Hibernate blatantly breach security like that? And more importantly, how do I do it? 😀
As you know, Spring can inject values to private instance variables, and Hibernate can
Share
When running without prohibitive security manager, you can obtain instance of corresponding method or field trough reflection and call setAccessible() on it.
Using Java security manager you can of course disable that by writing a custom policy.