日期:2014-05-16  浏览次数:20437 次

The database returned no natively generated identity value 错误的解决(转载)
配置文件
    <id name="id" column="id">
            <generator class="native" />
        </id>
然后我运行保存一条数据进去
The database returned no natively generated identity value
就会报这个错误
因为你native是根据看底层数据库的能力选择identity, sequence 或者hilo中的一个

而我建表的时候id没有指定

alter table `student` change `id` `id` int auto_increment

我们把我们的表的结构小小的改动一下就没问题了