saveOrUpdate():org.hibernate.StaleStateException

org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

 

 

原因:被saveorupdate操作的对象的id不是null,是“”空字符串,需要做类似如下处理:

 

	if("".equalsIgnoreCase(developTache.getId())){
			developTache.setId(null);
		}
		developTacheBiz.saveOrUpdate(developTache);// 保存环节

 

 

 

你可能感兴趣的:(saveOrUpdate():org.hibernate.StaleStateException)