+ -
当前位置:首页 → 问答吧 → ibatis

ibatis

时间:2011-10-08

来源:互联网

ibatis中若使用mysql数据库,插入数据的时候 怎么使用自动增长列 更为兄弟姐妹帮忙啊!!最好有源码

作者: nanmaidi   发布时间: 2011-10-08

哥,主键设为自动增长不行吗

作者: thumb3344   发布时间: 2011-10-08

<insert>里面有个<selectKey>
<insert id="insertProduct-Mysql" parameterClass="com.domain.Product">

  insert into PRODUCT(PRD_DESCRIPTION)

  values (#description#)

  <selectKey resultClass="int" keyProperty="id">

  SELECT LAST_INSERT_ID()

  </selectKey>

  </insert>

作者: JayYounger   发布时间: 2011-10-08

引用 1 楼 thumb3344 的回复:

哥,主键设为自动增长不行吗

对呀~

作者: LeeHomWong   发布时间: 2011-10-08

热门下载

更多