mysql 1364 hy000_mysql SQL Error: 1364, SQLState: HY000 保存错误
发布日期:2021-06-24 16:40:15 浏览次数:4 分类:技术文章

本文共 1429 字,大约阅读时间需要 4 分钟。

OrderForm orderForm = new OrderForm();

orderForm.setAddIp((String) map.get("ip"));// ip

orderForm.setAddTime(new Date());// 日期

orderForm.setOrderStatus(10);// 订单状态

orderForm.setAddUserId((long) map.get("addUserId"));

orderForm.setOrderType((byte) 0);// 下单方式

orderForm.setInvoiceType(0);

SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); // 时间格式精确到毫秒

String code = sdf.format(System.currentTimeMillis()); // 获得时间戳(毫秒)

orderForm.setOrderCode(map.get("userId") + code);// 订单号

orderForm.setMsg(storeAndGoodsVos.get(i).getMsg());

orderForm.setUserId((Long) map.get("userId"));

orderForm.setStoreId(storeAndGoodsVos.get(i).getStoreId());

orderForm.setTotalPrice((BigDecimal) map.get("totalPrice"));

orderForm.setOriginalPrice((BigDecimal) map.get("originalPrice"));

Address address = addressDao.findById((Long) map.get("addrId"));

Area area = new Area();

if (null != address) {

if (null != address.getArea()) {

area = address.getArea().getAreaByParentId();

}

}

orderForm.setAddress(address);

orderForm.setShopEvaluate(0);

orderForm.setIsDelete(false);

orderFormDao.save(orderForm);

if (orderForm.getOrderId() > 0) {

保存后报错 Field 'select TABLE_NAME

from information_schema.COLUMNS

is_delete' doesn't have a default value 但是我数据库表有is_delete字段 默认为0 实体类注解配置好了@Column(name = "is_delete")

public Boolean getIsDelete() {

return this.isDelete;

}

public void setIsDelete(Boolean isDelete) {

this.isDelete = isDelete;

}

之前好用 突然不好用了

转载地址:https://blog.csdn.net/weixin_33910305/article/details/113259026 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:mysqli拓展还能用mysql_最近在学习php,其中使用了MYSQLi扩展,注意是MYSQLi不是MYSQL(因PHP7已经不支持MYSQL扩展了)。...
下一篇:mysql 阿里云 添加磁盘空间_rds mysql磁盘空间包含

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月02日 19时45分07秒