Hi! I want to make a tool that will autogenerate annotations (via Javassist) to some classes.
I have doubts about the classloaders... suppose I have House.java, I make magic with Javassist and then I have a new version of House.java, with Hibernate annotations...
Then, I will "start" hibernate with AnnotationConfiguration, using configuration.addAnnotatedClass(..) and I will pass the new version of House.java, it should work by now.
If I get to this point, everything working, ¿shouldn't I have some problems with both versions of House.java?
I mean, if I want to create a new House and I do this: HibernateUtil.getSession().save( newHouse );
¿What happens if newHouse was using the first version (the one who did NOT have annotations)? I think it shouldn't work.
Any ideas? Thanks!
|