[英]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.