Java 类org.apache.ibatis.annotations.CacheNamespace 实例源码

项目:mybatis-plus-mini    文件:MybatisMapperAnnotationBuilder.java   
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);
    }
}
项目:MybatisCode    文件:MapperAnnotationBuilder.java   
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);
  }
}
项目:mybatis    文件:MapperAnnotationBuilder.java   
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);
  }
}
项目:mybatis-plus    文件:MybatisMapperAnnotationBuilder.java   
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);
    }
}
项目:utils    文件:BaseProcessor.java   
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;
}
项目:mybaties    文件:MapperAnnotationBuilder.java   
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);
  }
}
项目:play    文件:MapperAnnotationBuilder.java   
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);
  }
}
项目:mybatis-3    文件:MapperAnnotationBuilder.java   
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);
  }
}