简体   繁体   English

休眠状态奇怪的“ ORA-01400:无法将NULL插入”错误

[英]Hibernate Strange “ORA-01400: cannot insert NULL into” Error

there is a strange error ocurring to me. 我发生了一个奇怪的错误。 I'm working with Hibernate, I have mapped class called Widget, which has a Parameter class, but when I try to insert I get "ORA-01400: cannot insert NULL into..." 我正在使用Hibernate,我映射了一个名为Widget的类,该类具有Parameter类,但是当我尝试插入时得到“ ORA-01400:无法将NULL插入...”

The mapping is properly done as: 映射正确完成为:

<bag cascade="none" inverse="true" lazy="false" name="parameters" table="PARAMS" >
  <key column="WIDGET_ID" foreign-key="FK_PARAMS" not-null="true"/>
  <one-to-many class="Parameter"/>
</bag>

The wierd thing is that the not-null property is setted to "true" which forces to insert the ID value of the Widget Object. 奇怪的是,not-null属性设置为“ true”,这将强制插入Widget对象的ID值。

Thanks in advance 提前致谢

Did you solved the problem? 您解决问题了吗? I think I had the same problem 我想我也有同样的问题

ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate) ORA-01400:无法将空值插入(TABLE.COLUMN)(休眠)

In my case I solved modifying Db, making foreign keys also primary keys 就我而言,我解决了修改Db的问题,使外键也成为主键

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Hibernate和ORA-01400:无法插入NULL - Hibernate and ORA-01400: cannot insert NULL ORA-01400:无法将空值插入(TABLE.COLUMN)(休眠) - ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate) Spring JPA / HIbernate - Persisting to H2 works fine but fails with Oracle with ORA-01400 "cannot insert NULL" - Spring JPA / HIbernate - Persisting to H2 works fine but fails with Oracle with ORA-01400 "cannot insert NULL" JPA插入和可怕的ORA-01400:无法将NULL插入表名异常 - JPA inserts and the dreaded ORA-01400: cannot insert NULL into tablename exception ORA-01400: 无法插入 NULL 到,当使用 @onetomany 映射并且在子端具有复合主键时 - ORA-01400: cannot insert NULL into, when mapped with @onetomany and having composite primary key on child side ORA-01400:使用Hibernate插入外键时出错 - ORA-01400: Error while inserting Foreign Key using Hibernate oracle.jdbc.OracleDatabaseException: ORA-01400: cannot insert NULL into ("SCOTT"."D_TEST"."DTESTID") in spring boot jpa - oracle.jdbc.OracleDatabaseException: ORA-01400: cannot insert NULL into ("SCOTT"."D_TEST"."DTESTID") in spring boot jpa Hibernate:插入多对一:错误列不能为空 - HIbernate: insert many to one: error Column cannot be null 使用Spring数据/休眠进行删除:ORA-01407:无法更新为Null - Deletions with Spring data/Hibernate: ORA-01407: Cannot update to Null Hibernate + MSSQL,无法将值NULL插入列 - Hibernate + MSSQL, Cannot insert the value NULL into column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM