私のクラス構造は次のとおりです。
package com.xyz.abc.controller;
public class Roles {
public Static String REQ_ROLE = "LEARNER";
}
public class BaseController {
protected String getRole() { return something; }
}
public class AccountController extends BaseController {
@Cacheable(value="mycache", key="#accountId", condition="#root.target.getRole() == Roles.REQ_ROLE")
public String getAccount(final @PathVariable String accountId) { return account; }
}
SpEL を使用して Cacheable の状態で基本クラス関数を呼び出そうとしています。ただし、これは次のエラーをスローします。
Method call: Method getRole() cannot be found on com.xyz.abc.controller.AccountController type
このコンテキストからスーパー メソッドを呼び出すにはどうすればよいですか?