problem
hibernate 添加数据报错
reason
数据库字段定义为 not null
字段不能为空
solution
将数据库字段的属性 not null 改为allow null
例如:
CREATE TABLE `User` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(100) COLLATE utf8mb4_general_ci,
`age` int,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;