Skip to content

Instantly share code, notes, and snippets.

@vladdedita
Created November 29, 2023 09:14
Show Gist options
  • Save vladdedita/74129b75547cd43a71acf18fe150c34b to your computer and use it in GitHub Desktop.
Save vladdedita/74129b75547cd43a71acf18fe150c34b to your computer and use it in GitHub Desktop.
@Service
public class MyService {
public void methodA() {
// This method calls methodB internally
this.methodB();
}
@Cacheable("myCache")
public String methodB() {
// Perform some heavy computation / database access
return "Result";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment