Skip to content

Commit

Permalink
修改genId测试代码,保证id递增,避免重复
Browse files Browse the repository at this point in the history
  • Loading branch information
abel533 committed Dec 25, 2022
1 parent 6d58a78 commit 12d1ca2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>

<mybatis-config.version>1.1.0</mybatis-config.version>
<mybatis-config.version>1.1.1</mybatis-config.version>
<logback.version>1.2.11</logback.version>
<mybatis.version>3.5.11</mybatis.version>
<lombok.version>1.18.22</lombok.version>
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/io/mybatis/provider/model/User3.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public void setUsername(String username) {
}

public static class GenIdLong implements GenId<Long> {
private static long id = 1000;
@Override
public Long genId(EntityTable table, EntityColumn column) {
return System.currentTimeMillis() & 0xffff;
return id++;
}
}
}

0 comments on commit 12d1ca2

Please sign in to comment.