boolean类型
MySQL保存boolean值时用1代表TRUE,0代表FALSE,boolean在MySQL里的类型为tinyint(1),
MySQL里有四个常量:true,false,TRUE,FALSE,它们分别代表1,0,1,0,
MySQL没有boolean类型
例如:创建user表(male为 boolean类型)
create table user
(
id int primary key,
male boolean
)
可以成功执行,但是生成的user表中的male字段为TINYINT(1)类型
SO:以后遇到这种情况,POJO类中定义成boolean类型,在MySQL中定义成TINYINT(1)类型。