For our projects, we have entity classes where we add some technical code into all getters and setters. We would like to use javassist or similar library for bytecode instrumentation, to generate this code automatically.
Is there a way to do this during class loading time, since our ear project is running inside Java EE application server (J2EE 5 or more)? If not, I know, that similar problems are solved using dynamic proxies. But here I crash into another problem, how to do that, if entities will be used by JPA, because JPA vendors (such as Hibernate) create their own proxies on same entities.
Right now we are using JBoss, but I'm interested about portable solution.