Код: Выделить всё
@Cacheable()
public List getAllSystem(String client,Integer pageNumber,Integer pageSize,String sortBy, String sortDirection)
{
Pageable p=PageRequest.of(pageNumber,pageSize,sort);
Page sys=sysDao.findAll(p);
List allsys=sys.getContent();
return allsys;
}
Код: Выделить всё
@CachePut()
public SystemEntity addSystem(String client,SystemEntity sys)
{
Integer maxId = sysDao.findSystemMaxId();
System.out.println("maxId"+maxId);
sys.setSystemId(maxId);
sys.setCreatedDate(new Date());
System.out.println(sys);
return sysDao.save(sys);
}
Пожалуйста, дайте нам код, используя ключ @Cacheable и @Cacheput.
Подробнее здесь: https://stackoverflow.com/questions/784 ... pring-boot