I need to get access to the Configuration object of hibernate to get the list of PersistentClasses at run time. Is there anyway to do it?
Basically, I start my J2EE application with persistence.xml in JBoss. Hibernate automatically loads up my persistence unit and binds the entity manager and session factory to JNDI. I have a audit service which I can start and stop at any point. When I start my audit service, it needs the list of PersistentClass (as in hibernate's PersistentClass) to construct the configuration for audit objects. Hence the need for accesses the Configuration object at run time.
Any help to solve my problem is much appreciated. Thanks!
Ilavenil
|