我刚来Ibatis。如何使用Ibatis生成序列号并将其插入到mysql表中?序列号应以1000开头,以便它可以用作表中的主键。我使用了spring,ibatis和mysql。
发布于 2015-06-19 03:02:22
由于iBatis自2010年来就已经死亡,因此我推测MyBatis的使用情况。使用MyBatis you can use these annotations to insert and retrieve primary key from DB and map both to a interface
@Insert("insert into table2 (name) values(#{name})")
@SelectKey(statement="call identity()", keyProperty="nameId", before=false, resultType=int.class)
int insertTable2(Name name);https://stackoverflow.com/questions/30923179
复制相似问题