使用SqlSessionTemplate实现数据库操作

public class UserMapperImpl implements SmbmsUserMapper {
    private SqlSessionTemplate sqlSession;
    @Override
    public List getUserList(SmbmsUser user) {

        return sqlSession.selectList(
                "com.zhiyi.mapper.SmbmsUserMapper.getUserList",user);

    }
    public SqlSessionTemplate getSqlSession(){
        return sqlSession;
    }
    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession=sqlSession;
    }
}

spring配置


    
    
        
    
    
    
        
    

 

你可能感兴趣的:(使用SqlSessionTemplate实现数据库操作)