Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SpringBoot 2.1.4.RELEASE不在@Cacheable注释中缓存空值_Spring_Spring Boot_Spring Mvc_Spring Data Jpa_Spring Cache - Fatal编程技术网

SpringBoot 2.1.4.RELEASE不在@Cacheable注释中缓存空值

SpringBoot 2.1.4.RELEASE不在@Cacheable注释中缓存空值,spring,spring-boot,spring-mvc,spring-data-jpa,spring-cache,Spring,Spring Boot,Spring Mvc,Spring Data Jpa,Spring Cache,我有一个SpringBoot 2.1.4.RELEASE应用程序。使用存储库: @Repository public interface PercentageAlertXMenuRepository extends CrudRepository<PercentageAlertXMenu, Long> { @Cacheable("percentageAlertXMenu", unless="#result == null") PercentageAlertXMenu

我有一个SpringBoot 2.1.4.RELEASE应用程序。使用存储库:

@Repository
public interface PercentageAlertXMenuRepository extends CrudRepository<PercentageAlertXMenu, Long> {

    @Cacheable("percentageAlertXMenu", unless="#result == null")
    PercentageAlertXMenu findByPercentageAlertAndMenu (MenuPercentageAlert percentageAlert, Menu Menu);

您需要使用注释的
属性:

@Cacheable(value="percentageAlertXMenu", unless="#result == null")
@Cacheable(value="percentageAlertXMenu", unless="#result == null")