Hello , I am using JRebel but seems not to be able to reload the changes when I modify the sql fragments in the mapper.xml. I use mybats in a spring-based web environment. The configuration of applicationContext.xml is like this:
<bean id="shiroSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="${shiro.datasource}"/>
<property name="mapperLocations" value="classpath*:com/shiroside/authorization/dao/**/*.xml"/>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.shiroside.authorization.dao"/>
</bean>
<bean id="shiroTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="${shiro.datasource}"/>
</bean>
And I just define Mapper interface not concrete implement class which I guess would be implemented by mybatis itself. The mapper interface is like below:
package com.shiroside.authorization.dao;
import com.shiroside.authorization.model.Path;
import com.shiroside.authorization.model.Permission;
import com.shiroside.authorization.model.Role;
import com.shiroside.authorization.model.User;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface AuthzMapper {
List<Permission> selectAllPerms();
int selectSeq(String type);
void addSeq(String type);
List<Path> selectPathPerms();
List<Path> selectPathRoles();
void insertRole(Role role);
void insertRolePermAsso(HashMap params);
List<Role> selectAllRoles();
void deleteRole(int roleId);
void deleteRolePermAsso(int roleId);
List<User> selectAllUsers();
void deleteRoleOfUser(Map params);
void insertRole2User(Map params);
}
在 2012年9月22日星期六UTC+8上午9时13分52秒,moffit写道: