Atitit springboot mybatis spring 集成
Springboot1.4 mybatis3.4.6 /springbootMybatis
目录
1.2. 、配置mybatis MybatisConfig 2
package springbootMybatis;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@Mapper
@Component
//iocSpring5demo.MybatisMapperCls
public interface MybatisMapperCls {
//@Autowired
//public SqlSessionTemplate sqlSessionTemplate1;
/*
* 这是基于注解的映射方式,实现对数据的增删改查,将sql语句直接写在注解的括号中
* 这是一个接口,其不需要类去实现它
* 下边分别是插入,删除,修改,查询一个记录,查询所有的记录