Jim or anyone interested in this topic: finally I could insert annotations via runtime to N domain classes. It's working fine BUT with javarebel.
The problems are respected to ClassLoaders (I think T5 uses a custom classloader, or reuses javassist classloader to have "live class reloading"). In my particular case I'm using javarebel so I don't have problems with this solution, the steps are (big approuch) like this: 1) You have your domain classes in X package, you don't add hibernate annotations, you have to add other few annotations much simpler (only in cases like many2many.. much other cases are deducted from the code) 2) when you run your webapp, a listener is executed, it gets all classes from X package, process them and inserts hibernate annotations in runtime 3) Hibernate AnnotationConfiguration is fired Again, this approuch works OK based on javarebel. If you don't use javarebel, I don't know how to achieve this (suggestions are accepted :). I think this could be attractive for java starters who don't like configuring hibernate, few annotations and just works :) Thanks On Tue, Mar 2, 2010 at 10:10 AM, Alfonso Quiroga <alfonsose...@gmail.com>wrote: > I'm working on that, when I finish it, I'll post the solution here. > > On Tue, Mar 2, 2010 at 7:06 AM, Jim O'Callaghan <jc1000...@yahoo.co.uk>wrote: > >> Did you make any progress on this Alfonso, from a Tapestry contribution >> perspective? This would be really useful for me also. >> >> Regards, >> Jim. >> >> -----Original Message----- >> From: Alfonso Quiroga [mailto:alfonsose...@gmail.com] >> Sent: 26 February 2010 19:44 >> To: Tapestry users >> Subject: offtopic: javaassist for injecting annotations? >> >> Hi! I need to inject annotations to some classes at runtime, I know this >> is >> possible. Is javaassist the best choice? Is it hard to accomplish this? >> thanks! >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >