IllegalArgumentException: id to load is required for loading
更新时候报错
代码:
CSubject onePojo=subService.getById(id);
onePojo.setSubjectName(pojo.getSubjectName());
onePojo.setZjm(pojo.getZjm());//助记码
onePojo.setFpSubject(pojo.getFpSubject());//发票项目名称
onePojo.setBbSubject(pojo.getBbSubject());//统计类别名称
onePojo.setFyqdSubject(pojo.getFyqdSubject());//清单项目
subService.up(onePojo);//这个地方报错
log打印出
onePojo所有属性都有值(网上查找这个错误都是说传递了空的参数)
subjectNo值在log中打出来跟直接从数据库中查的是一样的
调用up方法一种提示 id to load is required for loading
配置文件:
<class name="com.bdcc.hoffice.materialsplatform.pojo.CSubject" table="C_SUBJECT">
<id name="subjectNo" column="SUBJECT_NO" type="java.lang.Long">
<generator class="com.bdcc.hoffice.common.util.CustomGenerator"/>
</id>
<property name="subjectName" column="SUBJECT_NAME" type="java.lang.String" length="50" not-null="true" />
<property name="zjm" column="ZJM" type="java.lang.String" length="10" not-null="true" />
<property name="subjectJb" column="SUBJECT_JB" type="java.lang.Long" length="19" not-null="false" />
<property name="subjectParent" column="SUBJECT_PARENT" type="java.lang.Long" length="19" not-null="false" />
<property name="ifDel" column="IF_DEL" type="java.lang.String" length="1" not-null="true" />
<property name="fpSubject" column="FP_SUBJECT" type="java.lang.String" length="50" not-null="false" />
<property name="bbSubject" column="BB_SUBJECT" type="java.lang.String" length="50" not-null="false" />
<property name="fyqdSubject" column="FYQD_SUBJECT" type="java.lang.String" length="50" not-null="false" />
<property name="orderNo" column="ORDER_NO" type="java.lang.Integer" length="3" not-null="false" />
</class>