You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/02/26 11:26:46 UTC

[GitHub] [incubator-shardingsphere] kimmking edited a comment on issue #4402: I want to use the self growing primary key. Is there any scheme available?

kimmking edited a comment on issue #4402: I want to use the self growing primary key. Is there any scheme available?
URL: https://github.com/apache/incubator-shardingsphere/issues/4402#issuecomment-591378420
 
 
   I guess max(id) is not nessesary and not exactly right.
   If you use JDBC directly, use `select last_insert_id()`  after insert a row in the same transaction to be better.
   If you use mybatis, you can config mapper like this:
   `<insert id="insert" keyProperty="id" useGeneratedKeys="true" ...`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services