Skip to content

Instantly share code, notes, and snippets.

@vladdedita
Created November 29, 2023 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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