How to obtain last insert id in Oracle using MyBatis?

后端 未结 4 1739
暗喜
暗喜 2020-12-16 07:01

I\'m inserting some data into an Oracle table and need to retrieve the id of the inserted row. Said id is being generated by a sequenc

4条回答
  •  Happy的楠姐
    2020-12-16 07:33

    Something like this should work

    class User {
      int userId
      ...
    }
    
    
      INSERT INTO user(login, name,...) VALUES(#{login}, #{name},...
    
    

提交回复
热议问题