I'm developing an auditing library like 'hibernate envers' and using JPA with hibernate as the provider. So my domain classes are annotated by JPA annotations. Because I need to access entity model before persistence provider (i.e. HibernatePersistence) build EntityMangerFactory, I create a subclass of HibernatePersistence. And in createEntityManagerFactory method I want to have some information about entities and their relationships. I do not want to start from scratch reading annotations on my entity classes. Envers use classes in org.hibernate.mapping package (PersistentClass, Property, ...). I'd like to use it but could not find some important things. For example I could not find which side is the owner of relation for all kind of *-to-many or one-to-one relations. I have some questions : 1. Basically, is this package the good choice at all? 2. If yes, how can I use it? 3. if no, is there a better way? what's it? may you help me to find the right way?
Thanks in advance for your help
|