"message": "could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
public static OrderDTO conver(OrderForm orderForm){
Gson gson=new Gson();
OrderDTO orderDTO=new OrderDTO();
orderDTO.setBuyerName(orderForm.getName());
orderDTO.setBuyerPhone(orderForm.getPhone());
// orderDTO.setBuyerAddress(orderForm.getAddress());
orderDTO.setBuyerOpenid(orderForm.getOpenid());
List orderDetailList=new ArrayList<>();
try {
orderDetailList= gson.fromJson(orderForm.getItems(),new TypeToken<List>(){}.getType());
}catch (Exception e){
log.error("[对象转换]错误,string={}",
orderForm.getItems());
throw new SellException(ResultEnum.PARAM_ERROR);
}
orderDTO.setOrderDetailList(orderDetailList);
return orderDTO;
}
注销 orderDTO.setBuyerAddress(orderForm.getAddress()); 这段。
@NotEmpty(message = “地址必填”)
private String address;
没有返回message的显示