当前位置: 首页>>代码示例>>Java>>正文


Java CacheNamespace类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Caratacus,项目名称:mybatis-plus-mini,代码行数:11,代码来源:MybatisMapperAnnotationBuilder.java

示例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);
  }
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:9,代码来源:MapperAnnotationBuilder.java

示例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;
}
 
开发者ID:storezhang,项目名称:utils,代码行数:28,代码来源:BaseProcessor.java

示例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);
  }
}
 
开发者ID:mybatis,项目名称:mybatis-3,代码行数:10,代码来源:MapperAnnotationBuilder.java


注:本文中的org.apache.ibatis.annotations.CacheNamespace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。