CacheStore implementation integrated with Spring and MyBatis framework
Current implementation depends on Spring v3.2 (or earlier) and MyBatis v3.3 (or earlier).
Add dependency to pom.xml like this:
<dependency>
<groupId>io.github.simukappu</groupId>
<artifactId>spring-mybatis-cachestore</artifactId>
<version>1.0.0</version>
</dependency>
-
Make datasource configuration in Spring context file.
See src/test/resources/META-INF/spring/datasource-context.xml. -
Make MyBatis SQL mapper configuration in MyBatis mapper xml file.
See src/test/resources/META-INF/mybatis/mapper.xml. -
Make Spring bean configuration of CacheStore in Spring context file.
See src/test/resources/META-INF/spring/cachestore-context.xml. -
Make Coherence cache configration file according to Coherence Spring Integration.
See src/test/resources/spring-cache-config.xml.
See also https://github.com/coherence-community/coherence-spring-integration.
-
Set Database environment.
-
Edit src/test/resources/META-INF/spring/datasource-context.xml for your environment.
-
Create table in your Database.
Sample SQL script for MySQL and Oracle is provided.
For MySQL,
$ mysql -u root
mysql> CREATE DATABASE IF NOT EXISTS coherence_tools_test;
mysql> use coherence_tools_test
mysql> source spring-mybatis-cachestore/script/create_table_mysql.sql
For Oracle,
$ sqlplus scott/tiger@localhost:1521/orcl @spring-mybatis-cachestore/script/create_table_oracle.sql
-
Edit pom.xml according to your datasource-context.xml.
-
Run test modules under test.com.simukappu.coherence.cachestore.spring.mybatis package as JUnit Test.
https://simukappu.github.io/coherence-tools/spring-mybatis-cachestore/docs/project-reports.html