@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface CacheNamespace
How to use:
@CacheNamespace(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 { // ... }
Modifier and Type | Optional Element and Description |
---|---|
boolean |
blocking
Returns whether block the cache at request time or not.
|
Class<? extends Cache> |
eviction
Returns the cache evicting implementation type to use.
|
long |
flushInterval
Returns the flush interval.
|
Class<? extends Cache> |
implementation
Returns the cache implementation type to use.
|
Property[] |
properties
Returns property values for a implementation object.
|
boolean |
readWrite
Returns whether use read/write cache.
|
int |
size
Return the cache size.
|
public abstract long flushInterval
public abstract boolean readWrite
true
if use read/write cache; false
if otherwisepublic abstract boolean blocking
true
if block the cache; false
if otherwisepublic abstract Property[] properties
Copyright © 2009–2020 MyBatis.org. All rights reserved.