MyBatis?3.2.6插入时候获取自增主键方法有二 ?以MySQL5.5为例: ?方法1: <insert?id="insert"?parameterType="Person"?useGeneratedKeys="true"?keyProperty="id">
????????insert?into?perso...
分类:
其他好文 时间:
2014-11-14 18:10:20
阅读次数:
184
<delete id="deleteCTQ" parameterType="java.lang.String"> DELETE FROM sqm_product_ctq_current where guid in <foreach item="idItem" collection="array" open="(" separator="," close=")"> #{idItem} </fo...
分类:
其他好文 时间:
2014-11-02 10:56:56
阅读次数:
162
一、坑爹 在使用Mybatis3.2.7+sqlite-jdbc3.3时,在执行查询操作,不管returnType和parameterType传什么值均报位于mapper.xml文件中的java.sql.SQLException:NYI错误...
分类:
数据库 时间:
2014-10-09 14:07:33
阅读次数:
461
业务层或者控制层的参数传到mapper文件中,mapper文件里的sql语句该如何接收呢。
第一种,实体对象的属性,这种比较简单,只要设置parameterType="com.zhdm.pojo.User"即可;
第二种,占位符传值:即用#{0},#{1}的方式接收,这种方式的弊端是如果参数有多个,要写多个占位符,顺序还不能搞错;
第三种,用@Param注解传值,在Dao方法里的参数前面加上...
分类:
其他好文 时间:
2014-09-05 22:27:32
阅读次数:
296
Oracle中获取刚刚插入记录的主键值: <insert?id="insertSelective"?parameterType="com.jxxx.p2pp.model.UUserInfo">
????<selectKey?resultType="java.math.BigDecimal"?order="BEFORE"?keyProperty="...
分类:
其他好文 时间:
2014-08-18 22:13:03
阅读次数:
234
Spring+SpringMVC+MyBatis启动项目到InitializingSpringrootWebApplicationContext不执行了我的问题原因是<selectid="getUser"parameterType="String"resultType="result">SELECTid,username,userpwdFROMt_admin_userwhereusername=#{userName}</select>返回类型错..
分类:
移动开发 时间:
2014-08-14 20:57:50
阅读次数:
262
<insertid="insertbatchinfotoemploees"parameterType="java.util.List">insertintoINFOTOEMPLOEEselectINFO_EMPLOEES.NEXTVAL,A.*from(<!--INFO_EMPLOEES为自增序列--><foreachcollection="list"item="item"index="index"separator="UNION">SELECT#{item.in..
分类:
数据库 时间:
2014-07-03 13:58:35
阅读次数:
232
1、XyzMapper.xml
insert
id=“doSomething"
parameterType="map"
useGeneratedKeys="true"
keyProperty=“yourId">
...
insert>
或
insert id=“doSomething" parameterType=“com.xx.y...
分类:
其他好文 时间:
2014-06-22 21:14:32
阅读次数:
261