Hi Jay, Using a RUNTIME retention policy should do the trick. What type of enhancement are you using? If you use build time enhancement, have you tried to decompile your enhanced entity classes? I just ran a quick test with OpenJPA trunk and my custom annotations show up in the decompiler output of the enhanced entity class files. Bean Validation (javax.validation.constraints.*) constraints also survive the enhancement process and are available at runtime using RUNTIME retention. Otherwise, the openjpa-integration/validation suite of tests would fail.
Could you provide a simple test that demonstrates the annotations being lost? I may be using a different style of enhancement or have some other environmental configuration difference. -Jeremy On Tue, Mar 15, 2011 at 1:41 PM, Jay Herrick <[email protected]> wrote: > Hello, > > I'm trying to add some custom annotations to my entity objects that I'll > use > at runtime for display purposes. I've done this before in other code and > I've defined my custom annotation with the > @Retention(RetentionPolicy.RUNTIME) annotation (It always tickles me that > we > use annotations to build annotations :) ) > > It looks like my annotations are removed when OpenJPA enhances the entity > classes. Is that really what's happening here? Is there any way I can ask > OpenJPA to leave my annotations intact? > > Thanks for any help you can offer, > > -Jay >
