I am new to Spring and read that we cannot use @Cacheablewith static methodbut cannot understand why we cannot use, so can anyone explain so that a beginner can easily understand? Can we use the static method to extract database table? I did the static methodwhole service layerDAO method , so what is it thread-safe?
@Cacheable
static method
database table
service layer
thread-safe
Developing my comment:
" . Spring - () . Java ."
Spring , (, Spring ).
, static , Spring ( , Spring)
static
, .
- @Cacheable, Spring - bean, , bean. , :
@Inject private MyBean myBean; ... myBean.myMethod("foo");
MyBean myMethod() @Cacheable, MyBean , , -, MyBean.myMethod() .
MyBean
myMethod()
MyBean.myMethod()
Proxys , . @Cacheable .