pisce wrote:
Cache definition works with annotations as far as I tried it, you can even declare a cached entity in persistence.xml with the following (for a read-only cache strategy) and no annotation:
<property name="hibernate.ejb.classcache.<qualified bean name>" value="read-only"/>
Thanks for verifying!
Quote:
My point is, all the mapping that used to take place is hbm.xml files can now be put directly in specific entity beans, thanks to JPA and Hibernate annotations, making it more comfortable to use and maintain.
You need to cache a bean, just put @Cache on the bean and you're done.
My point is that "just put @Cache on the bean" is maybe too easy - the most common issue I bump into when doing consulting is that people is doing caching waaay to agressive.
anyhow..
Quote:
The only drawback of this cool practice is that entity beans are often maintained by regenerating them from the database. And nobody wants to manually edit entity beans each time they are regenerated.
So, you can avoid making hbm.xml files as I do, but not a reveng.xml file.
yes.
Quote:
I'm aware that adding those possibilities will make the hbm and reveng format types very alike, but what if this is needed by your users (I saw several JIRA issues for this)? maybe reveng.xml files have become more critical than hbm.xml files since Java 5 and JPA are out?
Yes, but @Cache is an essential cornercase...especially since proper mapping of entities and their assocoations (lazy/eager/etc.) and proper collection types is *much* more important too look into before doing caching.
So we should at least get those things covered before adding good "caching" support to reveng.xml.
Care to contribute ? :)