-1

I have an SpringBoot 2.1.4.RELEASE app. with a repository:

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

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

but I got a compilation error:

Syntax error on token ""percentageAlertXMenu"", invalid 
 MemberValuePairs
Nuñito Calzada
  • 4,394
  • 47
  • 174
  • 301

1 Answers1

0

You need to use the value attribute of the annotation:

@Cacheable(value="percentageAlertXMenu", unless="#result == null")
Strelok
  • 50,229
  • 9
  • 102
  • 115