开发者

Hibernate Strange "ORA-01400: cannot insert NULL into" Error

开发者 https://www.devze.com 2023-02-10 09:20 出处:网络
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

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..."

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.

Thanks in advance


Did you solved the problem? I think I had the same problem

ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate)

In my case I solved modifying Db, making foreign keys also primary keys

0

精彩评论

暂无评论...
验证码 换一张
取 消