当前位置: 首页 > 工具软件 > EBank > 使用案例 >

异常:identifier of an instance of cn.ebank.pojo.News was altered from 2 to 2;

顾嘉纳
2023-12-01

 原因:

 <id name="id" type="java.lang.Integer">
            <column name="ID" precision="22" scale="0" />
            <generator class="sequence">
             <param name="sequence">NEWS_ID_SEQ</param>
            </generator>
        </id>

把红色部分变成

 <id name="id" type="java.lang.Long">
            <column name="ID" precision="22" scale="0" />
            <generator class="sequence">
             <param name="sequence">NEWS_ID_SEQ</param>
            </generator>
        </id>、

把dao和service里对应的Integer改成Long

 

 类似资料: