public interface MyRespository extends CrudRepository<MyEntity, Long> {
@CachePut(value = "mycache", key = "id")
@Override
public <S extends MyEntity> S save(S entity);
}
@Entity
public class MyEntity {
@Id
private Long id;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
}
結果:
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): タイプ 'org.springframework.cache.interceptor.CacheExpressionRootObject' のオブジェクトでプロパティまたはフィールド 'id' が見つかりません - おそらく公開されていませんか?