使用NutTxDao获取不到自增ID,ID为0
代码:
Sql insertSql = Sqls.create("insert into test (a,b) values (1,2)");
Sql getIdSql = Sqls.create("select @@IDENTITY");
getIdSql.setCallback(Sqls.callback.integer());
tx.execute(insertSql, getIdSql);
int test_id = getIdSql.getInt();
System.out.println("test_id:" + test_id);