Data truncation: Column was set to data type implicit default; NULL supplied for

hibernate,one to many关系时出现:Data truncation: Column was set to data type implicit default; NULL supplied for NOT NULL column :

解决方案:

 

个人认为inverse属性是用来设置主动权的。在archive的set(empInfo)中设置其为true,表示把主动权交给了

archive

这样设置之后,问题确实解决了!

 

在这里非常感谢:ccsuliuxing!

 

Thank you very much ,ccsuliuxing!

 

 

 

你可能感兴趣的:(Hibernate)