java学习简单笔记20190313

JPA的Repository接口,实体类自建接口继承

public inteface PersonRepository extends JpaRepository<Person,Long>

其中Long类型是指类的主键列的类型

Cache缓存的使用@Cacheable查询,如果缓存中存在,则从缓存中读,不存在时从数据库读后放入缓存,

@Cacheput(key='person.id",value="people")加入到缓存中

@CacheEvit(value="people"),从缓存中删除指定主键的

原文地址:https://www.cnblogs.com/lofe/p/10521272.html