Hi Adam, If you're using OpenJPA 2.0.0 you can use the JPA 2.0 cache properties to do exactly what you want. Just set add <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> to persistence.xml and put @Cacheable(true) in the entities you want to be cached.
Older versions of OpenJPA aren't as flexible. You need to list the entities you want cached (or those you want not to be cached) in persistence.xml. Take a look at example 10.4 and 10.5 in the DataCache configuration<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_cache_conf>section of the manual. Hope this helps, -mike On Sun, Apr 25, 2010 at 12:27 PM, Adam Borkowski <[email protected]>wrote: > > Is it possible to somehow set data cache disabled by default for all > classes > and then enable only few chosen by annotating them with > @DataCache(enabled=true)? > > thanks, > Adam > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Disabling-all-objects-in-Data-Cache-initially-tp4959150p4959150.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
