博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 1364 hy000_mysql SQL Error: 1364, SQLState: HY000 保存错误
阅读量:1545 次
发布时间:2019-04-21

本文共 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;

}

之前好用 突然不好用了

转载地址:http://mhwcy.baihongyu.com/

你可能感兴趣的文章
LAMP架构八( Apache域名跳转301)
查看>>
线上测试bug工具
查看>>
无法获取签名信息,请上传有效包(110506)
查看>>
【APICloud系列|10】最新苹果APP上架App Store流程(超详细)
查看>>
【APICloud系列|11】使用APPuploader申请ios开发证书及ios发布证书教程
查看>>
【APICloud系列|12】ios真机调试时如何添加新设备的udid?
查看>>
前端开发必备的1个CSS框架
查看>>
【APICloud系列|13】移动端适配通揽
查看>>
常用的视频下载网站
查看>>
问题:三元向量的比较
查看>>
C++ 在屏幕上用星号打印菱形
查看>>
使用微信开发者工具添加小程序底部导航栏报错
查看>>
Android killer软件闪退的解决办法?
查看>>
eclipse中在类saolei.Test 中找不到main方法
查看>>
安卓车机没有ADB调试,任意安装第三方软件教程
查看>>
某小型校园网规划与设计要点(课程报告)
查看>>
前端页面通过web3.eth.accounts无法获取账户信息
查看>>
解决 invalid input detected at ‘^’ marker的问题
查看>>
用C语言实现津巴布韦这道算法题?
查看>>
有什么好一点的方法读jdk源码吗?
查看>>