目标 : 把snaker和mybatis结合
环境 : spring mybatis mysql
1,首先导入 snaker-mybatis.jar
2,配置好 anaker数据源 和数据库
3,引入底下的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-lazy-init="true">
<description>SnakerEngine配置 </description>
<bean class="org.snaker.engine.spring.SpringSnakerEngine">
<property name="processService" ref="processService"/>
<property name="orderService" ref="orderService"/>
<property name="taskService" ref="taskService"/>
<property name="queryService" ref="queryService"/>
<property name="managerService" ref="managerService"/>
</bean>
<bean id="dbAccess" class="org.snaker.engine.access.mybatis.MybatisAccess">
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
<bean id="processService" class="org.snaker.engine.core.ProcessService">
<property name="access" ref="dbAccess"/>
<property name="cacheManager" ref="cacheManager"/>
</bean>
<bean id="orderService" class="org.snaker.engine.core.OrderService">
<property name="access" ref="dbAccess"/>
</bean>
<bean id="taskService" class="org.snaker.engine.core.TaskService">
<property name="access" ref="dbAccess"/>
</bean>
<bean id="managerService" class="org.snaker.engine.core.ManagerService">
<property name="access" ref="dbAccess"/>
</bean>
<bean id="queryService" class="org.snaker.engine.core.QueryService">
<property name="access" ref="dbAccess"/>
</bean>
<bean id="cacheManager" class="org.snaker.engine.cache.memory.MemoryCacheManager"/>
<!-- spring jdbc access
<bean id="dbAccess" class="org.snaker.engine.access.spring.SpringJdbcAccess">
<property name="dataSource" ref="dataSource"/>
<property name="lobHandler" ref="lobHandler"/>
</bean>
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />
-->
</beans>