error:ids for this class must be manually assigned before calling save()

来源:互联网 发布:下载风行软件 编辑:程序博客网 时间:2024/05/22 03:33

error:ids for this class must be manually assigned before calling save()

出现此错误是生成配置文件时,主键的生成方式有问题,通用的一般使用native,如要效率更高一些,可根据选用的数据库而定。

      解决方案:

      <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="native"/>
      </id>

原创粉丝点击