Package org.apache.ibatis.annotations
Annotation Type CacheNamespace
-
@Documented @Retention(RUNTIME) @Target(TYPE) public @interface CacheNamespaceThe annotation that specify to use cache on namespace(e.g. mapper interface).
How to use:@acheNamespace(implementation = CustomCache.class, properties = { @Property(name = "host", value = "${mybatis.cache.host}"), @Property(name = "port", value = "${mybatis.cache.port}"), @Property(name = "name", value = "usersCache") }) public interface UserMapper { // ... }- Author:
- Clinton Begin, Kazuki Shimizu
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanblockingReturns whether block the cache at request time or not.java.lang.Class<? extends Cache>evictionReturns the cache evicting implementation type to use.longflushIntervalReturns the flush interval.java.lang.Class<? extends Cache>implementationReturns the cache implementation type to use.Property[]propertiesReturns property values for a implementation object.booleanreadWriteReturns whether use read/write cache.intsizeReturn the cache size.
-
-
-
Element Detail
-
implementation
java.lang.Class<? extends Cache> implementation
Returns the cache implementation type to use.- Returns:
- the cache implementation type
- Default:
- org.apache.ibatis.cache.impl.PerpetualCache.class
-
-
-
eviction
java.lang.Class<? extends Cache> eviction
Returns the cache evicting implementation type to use.- Returns:
- the cache evicting implementation type
- Default:
- org.apache.ibatis.cache.decorators.LruCache.class
-
-
-
properties
Property[] properties
Returns property values for a implementation object.- Returns:
- property values
- Since:
- 3.4.2
- Default:
- {}
-
-