栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

[mybatis]Mapper XML Files

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[mybatis]Mapper XML Files

The true power of MyBatis is in the Mapped Statements. This is where the magic happens.

CUD

mybatis运行CUD直接定义以下类型返回值

Integer,Long,Boolean 我们需要手动提交数据

sqlSessionFactory.openSession();—>手动提交sqlSessionFactory.openSession(true);—>自动提交

接口:

package com.atguigu.mybatis.dao;

import com.atguigu.mybatis.bean.Employee;

public interface EmployeeMapper {


    public Employee getEmpById(Integer id);

    public Long addEmp(Employee employee);

    public boolean updateEmp(Employee employee);

    public void deleteEmpById(Integer id);



}

映射文件: