hi.. all of our current pojo's are configured with hbm files, can we keep them but still have only the audited annotation with envers?
also does envers audit components? if not , how can we audit them?
first of all you can find the answers to both of your questions in the docs.
Envers is for jpa entities (annotated POJOs) only, which is actually not a problem I guess?
You can audit components accordings to the docs. I never tested it though.
actually it does present a problem as we have 2-3 legacy applications with loads of hbm files.
does this mean we cannot use envers? is there another framework like it?
We are using envers with hbm files.
We found a problem when an interface is mapped (it's no possible to use annotated interfaces, so the problem only happens with hbm files) but we fixed it. You can see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156233 for more information.
i tried to look through the documentation, and i'm wondering is it possible to mix hibernate annotations and hbm files?
the reason i'm asking is this, we have an abstract class which all persistent entities must extend. this class is currently un-mapped. this class should be mapped as an identifier and a few dates. can i used mappedSuperclass on this class and leave the rest of hbm's which map the concrete classes which extend it as they are ?
Hi Elhanan, here is an approach...
I've found this on hibernate annotations documentation (http://docs.jboss.org/hibernate/stable/annotations/reference/en/html/ch01.html#setup-configuration)
In section 1.2 it says:
There is no other difference in the way you use Hibernate APIs with annotations, except for this startup routine change or in the configuration file. You can use your favorite configuration method for other properties ( hibernate.properties, hibernate.cfg.xml, programmatic APIs, etc). You can even mix annotated persistent classes and classic hbm.cfg.xml declarations with the same SessionFactory. You can however not declare a class several times (whether annotated or through hbm.xml). You cannot mix configuration strategies (hbm vs annotations) in a mapped entity hierarchy either.
so in short i can use envers, with hbm'd classes , i would also need to use hiberate-annoations for it, and once i'll do that, i can begin using hibernate annoations on new entities, but cannot mix class tree like i wanted, oh well :)