Data truncated for column 'last_edit_time' at row 1

org.springframework.dao.DataIntegrityViolationException: 
### Error updating database.  Cause: java.sql.SQLException: Data truncated for column 'last_edit_time' at row 1
### The error may exist in class path resource [mapper/ShopDao.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: INSERT INTO  tb_shop(owner_id,area_id,shop_category_id,shop_name,  shop_desc,shop_addr,phone,shop_img,priority,create_time,  last_edit_time,enable_status,advice)  VALUES  (?,?,?,  ?,?,?,?,?,?,  ?,?,?,?  );

翻译:第1行的列“last edit time”的数据被截断

请看数据库
在这里插入图片描述

// 这是实体类
public void Shop(){
	...
	// 创建时间
	private Date createTime;
	// 修改时间
	private Date lastEditTime;
}

搞半天,原来是类型写错了

发布了39 篇原创文章 · 获赞 6 · 访问量 1996

猜你喜欢

转载自blog.csdn.net/weixin_45493345/article/details/103828228
今日推荐