原文:http://blog.csdn.net/woshixuye/article/details/7089508
MySQL保存boolean值時用1代表TRUE,0代表FALSE。boolean在mysql里的類型為tinyint(1)。MySQL里有四個常量:true,false,TRUE,FALSE分別代表1,0,1,0。
create table test
(
id int primary key,
bl boolean
)
這樣是可以創建成功。查看建表后的語句會發現,mysql把它替換成tinyint(1)。在pojo里直接定義該屬性為布爾值即可:private Boolean status