공부 (@Deprecated)

[Spring] Invoke Spring @Cacheable from Another Method of Same Bean

가비로그 2023. 11. 4. 15:02
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
반응형