티스토리 뷰

728x90
@Service
@CacheConfig(cacheNames = "square")
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class MathService {

    @Autowired
    private MathService self;

    // other code

    public double sumOfSquareOf3() {
        return self.square(3) + self.square(3);
    }
}

https://www.baeldung.com/spring-invoke-cacheable-other-method-same-bean

 

728x90
댓글