-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I'm using ZK and Hibernate.
I want to create a class dynamically (from a template, then compile the class by running javac, then map the class name in hibernate.cfg.xml), but if I don't redeploy/restart the application, that new class will never be loaded. is there anyway to restart hibernate without restarting the application?
Hi efm,
This is NOT related to ZK. In future you might want to post only ZK related queries here. For now here is what I think you can do to solve your problem.
>> I want to create a class dynamically (from a template, then compile the class by running javac, then map the class name in hibernate.cfg.xml)
You can use some jvm instrumentation lib such as javassist to create classes, have them compiled and loaded by the class loader on the fly.
>> is there anyway to restart hibernate without restarting the application
Now to add your dynamically created entities you might wanna take a look at this approach that uses dom4j session to do dynamic mapping. You will have to be careful about the webapp loading and your custom entity/class loading sequence though. Reserach more on the internet for this.
Thanks
- Ashish
Asked: 2010-05-30 13:28:12 +0800
Seen: 303 times
Last updated: May 30 '10