Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

前端 未结 30 3900
夕颜
夕颜 2020-11-28 20:47

I get following hibernate error. I am able to identify the function which causes the issue. Unfortunately there are several DB calls in the function. I am unable to find the

30条回答
  •  甜味超标
    2020-11-28 21:20

    Solution: In the Hibernate mapping file for the id property, if you use any generator class, for that property you should not set the value explicitly by using a setter method.

    If you set the value of the Id property explicitly, it will lead the error above. Check this to avoid this error. or It's error show when you mention in the mapping file the field generator="native" or "incremental" and in your DATABASE the table mapped is not auto_incremented Solution: Go to your DATABASE and update your table to set auto_increment

提交回复
热议问题