zoukankan      html  css  js  c++  java
  • 缓存,spring

    applicationcontext.xml

    xmlns:cache="http://www.springframework.org/schema/cache"

    xsi:schemaLocation=http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd

    <cache:annotation-driven cache-manager="cache"/>

    <bean id="cache" class="org.springframework.cache.support.SimpleCacheManager">
            <property name="caches">
                <list>
                    <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"  p:name="qus"></bean>
                    <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"  p:name="clo"></bean>
                </list>
            </property>
        </bean>

    业务层

    方法上面实现@Cacheable("clo")

    例如:

    @Cacheable("clo")
        public List<Clothingcategory> cFindAll() {
            return clothingcategoryDAO.findAll();
        }

    切记:clo是在bean在配置的,请看上面

  • 相关阅读:
    运算符
    格式化输出
    while循环
    if 判断语句
    Swift # 字典
    Swift # 数组
    Swift # 字符串
    [ Swift # 函数 ]
    [ Bubble Sort ]& block
    数据结构 # 二叉树/堆/栈
  • 原文地址:https://www.cnblogs.com/danmao/p/4233288.html
Copyright © 2011-2022 走看看