可以在 .xml中 <insert></insert>里面加入 useGeneratedKeys="true" keyProperty="id" ,就想这样<insert useGeneratedKeys="true" keyProperty="id"></insert>。
就可以在后台直接用entity.getId获取insert 自增长的id。
可以在 .xml中 <insert></insert>里面加入 useGeneratedKeys="true" keyProperty="id" ,就想这样<insert useGeneratedKeys="true" keyProperty="id"></insert>。
就可以在后台直接用entity.getId获取insert 自增长的id。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。