获取自增主键的值:mysql支持自增主键,自增主键值的获取,mybatis也是利用statement.getGenreatedKeys():useGeneratedKeys="true":使用自增主键获取主键值策略keyProperty:指定对应的主键属性,也就是mybatis获取到主键值以后,将这个值封装给javaBean的哪个属性 1.接口定义 package com.mybatis.dao; import com.mybatis.bean.Employee; public int
一.Mybatis中用#{}和${}获取输入参数的区别 1.“#{}“和“${}”都可以从接口输入中的map对象或者pojo对象中获取输入的参数值.例如 <mapper namespace="com.hh.dao.UserDao"> <select id="selectByIdList" resultType="com.hh.domain.SysUser"> select * from user where id=#{id