【发布时间】:2017-12-21 09:58:47
【问题描述】:
我尝试使用 @PatchRequest 测试我的 API,但出现以下错误。
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/intranet-api] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [update portal.dbo.DANCE_MASTER set name=?, age=?, gender=?, grade=?,status=?, updated_by=?, updated_ts=? where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch] with root cause
java.sql.BatchUpdateException: Cannot insert the value NULL into column 'name', table 'ctcportal1.dbo.DANCE_MASTER'; column does not allow nulls. UPDATE fails.
从显示的错误来看,我似乎应该为所有字段提供更新的值。但是,我只想更新表中的某些字段。
【问题讨论】: