通過調用java端對數據庫表進行添加操作,出現以下錯誤:
ERROR AssertionFailure:22 - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in com.jeanswest.model.TAfteret entry (don't flush the Session after an exception occurs)請問下有人知道是怎么回事么?
下面hibernate映射文件:<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" ><hibernate-mapping package="com.jeanswest.model">
<class
name="TAfteret"
table="t_afteret"
>
<meta attribute="sync-DAO">false</meta>
<id
name="Id"
type="integer"
column="f_afteretid"
>
<generator class="native"/>
</id> <property
name="FIsaskchange"
column="f_isaskchange"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsaskback"
column="f_isaskback"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FDescription"
column="f_description"
type="string"
not-null="false"
/>
<property
name="FIsok"
column="f_isok"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsokdescription"
column="f_isokdescription"
type="string"
not-null="false"
/>
<property
name="FIsafterchange"
column="f_isafterchange"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsafterback"
column="f_isafterback"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FAskchangetime"
column="f_askchangetime"
type="string"
not-null="false"
length="50"
/>
<property
name="FAskbacktime"
column="f_askbacktime"
type="string"
not-null="false"
length="10"
/>
<property
name="FAfterchangetime"
column="f_afterchangetime"
type="string"
not-null="false"
length="50"
/>
<property
name="FAfterbacktime"
column="f_afterbacktime"
type="string"
not-null="false"
length="50"
/>
<property
name="FIssend"
column="f_issend"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIssign"
column="f_issign"
type="boolean"
not-null="false"
length="1"
/>
<many-to-one
name="FOrderid"
column="f_orderid"
class="TOrder"
not-null="true"
>
</many-to-one>
<many-to-one
name="FGoodsid"
column="f_goodsid"
class="TGoods"
not-null="true"
>
</many-to-one>
</class>
</hibernate-mapping>
ERROR AssertionFailure:22 - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in com.jeanswest.model.TAfteret entry (don't flush the Session after an exception occurs)請問下有人知道是怎么回事么?
下面hibernate映射文件:<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" ><hibernate-mapping package="com.jeanswest.model">
<class
name="TAfteret"
table="t_afteret"
>
<meta attribute="sync-DAO">false</meta>
<id
name="Id"
type="integer"
column="f_afteretid"
>
<generator class="native"/>
</id> <property
name="FIsaskchange"
column="f_isaskchange"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsaskback"
column="f_isaskback"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FDescription"
column="f_description"
type="string"
not-null="false"
/>
<property
name="FIsok"
column="f_isok"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsokdescription"
column="f_isokdescription"
type="string"
not-null="false"
/>
<property
name="FIsafterchange"
column="f_isafterchange"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIsafterback"
column="f_isafterback"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FAskchangetime"
column="f_askchangetime"
type="string"
not-null="false"
length="50"
/>
<property
name="FAskbacktime"
column="f_askbacktime"
type="string"
not-null="false"
length="10"
/>
<property
name="FAfterchangetime"
column="f_afterchangetime"
type="string"
not-null="false"
length="50"
/>
<property
name="FAfterbacktime"
column="f_afterbacktime"
type="string"
not-null="false"
length="50"
/>
<property
name="FIssend"
column="f_issend"
type="boolean"
not-null="false"
length="1"
/>
<property
name="FIssign"
column="f_issign"
type="boolean"
not-null="false"
length="1"
/>
<many-to-one
name="FOrderid"
column="f_orderid"
class="TOrder"
not-null="true"
>
</many-to-one>
<many-to-one
name="FGoodsid"
column="f_goodsid"
class="TGoods"
not-null="true"
>
</many-to-one>
</class>
</hibernate-mapping>
解决方案 »
- linux下下载文件的路径问题
- SQLserver2008如何自己导入文件
- ibatis连接数据库的问题
- 数据存入数据库时出错,请高手指教!
- webservice报错:java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
- websphere 不能发布WAR文件,提示“配置库中已存在应用程序” ---急!!
- dom4j怎么获得指定名称的节点信息
- 一个无关Jsp的问题
- ★★★★★专用java资料FTP空间开通,奉献给喜欢将java资料共享的朋友。★★★★★
- struts1.1中validation.xml和validator-rules.xml对应的关系?
- 使用keytool工具做SSL怎么添加2个网站域名
- 在线等,jaxb解析xsd生成java文件的问题
将数据空中的f_afteretid字段设置成标识(identity(1,1))