|
Hibernate example source code file (EhCacheRegionTest.java)
The Hibernate EhCacheRegionTest.java source codepackage org.hibernate.test.cache.ehcache; import org.hibernate.cache.ehcache.EhCacheRegionFactory; import org.hibernate.cache.ehcache.internal.strategy.ItemValueExtractor; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import java.util.Map; /** * @author Alex Snaps */ public class EhCacheRegionTest extends EhCacheTest { @Override protected void configCache(final Configuration cfg) { cfg.setProperty( Environment.CACHE_REGION_FACTORY, EhCacheRegionFactory.class.getName() ); cfg.setProperty( Environment.CACHE_PROVIDER_CONFIG, "ehcache.xml" ); } @Override protected Map getMapFromCacheEntry(final Object entry) { final Map map; if ( entry.getClass() .getName() .equals( "org.hibernate.cache.ehcache.internal.strategy.AbstractReadWriteEhcacheAccessStrategy$Item" ) ) { map = ItemValueExtractor.getValue( entry ); } else { map = (Map) entry; } return map; } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate EhCacheRegionTest.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.