本文整理汇总了Java中org.apache.ibatis.annotations.CacheNamespace类的典型用法代码示例。如果您正苦于以下问题:Java CacheNamespace类的具体用法?Java CacheNamespace怎么用?Java CacheNamespace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CacheNamespace类属于org.apache.ibatis.annotations包,在下文中一共展示了CacheNamespace类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseCache
import org.apache.ibatis.annotations.CacheNamespace; //导入依赖的package包/类
private void parseCache() {
CacheNamespace cacheDomain = type.getAnnotation(CacheNamespace.class);
if (cacheDomain != null) {
Integer size = cacheDomain.size() == 0 ? null : cacheDomain.size();
Long flushInterval = cacheDomain.flushInterval() == 0 ? null : cacheDomain.flushInterval();
Properties props = convertToProperties(cacheDomain.properties());
assistant.useNewCache(cacheDomain.implementation(), cacheDomain.eviction(), flushInterval, size,
cacheDomain.readWrite(), cacheDomain.blocking(), props);
}
}
示例2: parseCache
import org.apache.ibatis.annotations.CacheNamespace; //导入依赖的package包/类
private void parseCache() {
CacheNamespace cacheDomain = type.getAnnotation(CacheNamespace.class);
if (cacheDomain != null) {
Integer size = cacheDomain.size() == 0 ? null : cacheDomain.size();
Long flushInterval = cacheDomain.flushInterval() == 0 ? null : cacheDomain.flushInterval();
assistant.useNewCache(cacheDomain.implementation(), cacheDomain.eviction(), flushInterval, size, cacheDomain.readWrite(), cacheDomain.blocking(), null);
}
}
示例3: makeClass
import org.apache.ibatis.annotations.CacheNamespace; //导入依赖的package包/类
protected TypeSpec.Builder makeClass(TypeElement clazzElement, RedisMapperProperties properties) {
TypeSpec.Builder clazzBuilder = TypeSpec.interfaceBuilder(clazzElement.getSimpleName().toString() + STAFF)
.addModifiers(Modifier.PUBLIC);
clazzBuilder.addAnnotation(Mapper.class);
if (!checkXMLFileExist(clazzElement)) {
AnnotationSpec cacheAnnotation = AnnotationSpec.builder(CacheNamespace.class)
.addMember("flushInterval", "$L", properties.getFlushInterval())
.addMember("implementation", "$L.class", properties.getImplementation())
.addMember("eviction", "$L.class", properties.getEviction())
.addMember("size", "$L", properties.getSize())
.addMember("readWrite", "$L", properties.isReadWrite())
.addMember("blocking", "$L", properties.isBlocking())
.build();
clazzBuilder.addAnnotation(cacheAnnotation);
for (TypeMirror interfaceClass : clazzElement.getInterfaces()) {
clazzBuilder.addSuperinterface(TypeName.get(interfaceClass));
}
clazzBuilder.addSuperinterface(TypeName.get(clazzElement.asType()));
} else {
updateXML(clazzElement, properties);
}
return clazzBuilder;
}
示例4: parseCache
import org.apache.ibatis.annotations.CacheNamespace; //导入依赖的package包/类
private void parseCache() {
CacheNamespace cacheDomain = type.getAnnotation(CacheNamespace.class);
if (cacheDomain != null) {
Integer size = cacheDomain.size() == 0 ? null : cacheDomain.size();
Long flushInterval = cacheDomain.flushInterval() == 0 ? null : cacheDomain.flushInterval();
Properties props = convertToProperties(cacheDomain.properties());
assistant.useNewCache(cacheDomain.implementation(), cacheDomain.eviction(), flushInterval, size, cacheDomain.readWrite(), cacheDomain.blocking(), props);
}
}