I have 2 ways to lookup a customer record (code below), customerGuid and customerId are 2 different fields in Customer object.
Suppose that i lookup customer by customerId once, is there a way for me to lookup customer by guid directly from cache without querying backend, Assuming both the methods return type is Customer.
public class CustomerLookup { @Cacheable("customerCache") public Customer getCustomerByGuid(final String customerGuid) { // some implementation here... } @Cacheable("customerCache") public Customer getCustomerByCustId(final String customerId) { // some implementation here... } }