mysql mybatis useGeneratedKeys Field 'ID' doesn't have a default value的问题
原因是:创建表时没有让id自动增长:
CREATE TABLE `STORAGE_VIRTUAL` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `STORAGE_ID` int(11) NOT NULL, `VIRTUAL_TYPE` varchar(50) NOT NULL, PRIMARY KEY (`ID`), KEY `FK_STORAGE` (`STORAGE_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
AUTO_INCREMENT 不能丢