Hibernate执行update日期报错

0
Hibernate MySQL SQL C/C++ Go 15472 次浏览

clipboard.png
执行上述代码 报错如下:

"PreparedStatementCallback; SQL [UPDATE yposx_store_goods SET update_time=?, store_market_enable=?, goods_id=? WHERE shop_id='5' AND goods_id='139'Data truncation: Incorrect datetime value: 'Mon Nov 12 15:39:14 CST 2018' for column 'update_time' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'Mon Nov 12 15:39:14 CST 2018' for column 'update_time' at row 1",

执行插入是没有问题的

请尽量让自己的答案能够对别人有帮助

2个答案

默认排序 按投票排序
0

 

只想告诉我这非常有帮助,感谢您花时间写这篇文章。    candy crush

0

Hibernate merge can be used to update existing values, however this method create a copy from the passed entity object and return it. The returned object is part of persistent context and tracked for any changes, passed object is not tracked. So if you have an attached objects you can use update. If you have a detached objects then use merge which first attaches the object to the session then will do an update. Visit academic writing