I have designed the Data access object mybatis mapper to read the read only data from Mysql database.
@Mapper
public interface XYZMapper {
@Select("SELECT TYPES FROM abc WHERE STORE_ID = #{storeId} and CUSTOMER_ID = #{customerId}")
public String getDisabledSubscriptions(@Param("storeId") int storeId, @Param("customerId") int customerId);
@Select("SELECT TYPES as messageTypes, NAME as eventName FROM abc WHERE STORE_ID = #{storeId}")
public EventSubscription getEventAllSubscriptions(@Param("storeId") int storeId);
http://mybatis.org/hazelcast-cache/
Above link gives solutions for caching using hazelcast. This is used when we configure mapper as xml file. How can we cache each of the above queries as L2 cache by using annotation mapper
Solved the issue in following steps
a) @EnableCaching with SpringBootApplication classes
b) add @Cacheable ("abc") in every database method defined in mapper (that you wanted to cache)
c) Defined hazelcast.yml in resources folder with
hazelcast: network: join: multicast: enabled: true