MYSQL保存boolean值时用1代表TRUE,0代表FALSE,boolean在MySQL里的类型为tinyint(1)。
MySQL里有四个常量:true,false,TRUE,FALSE,它们分别代表1,0,1,0。
<wbr></wbr>
MySQL没有boolean类型。这也是比较奇怪的现象。例:
create table test
(
<wbr><wbr> id int primary key,<br><wbr><wbr> bl boolean<br>
)<br><br><br>
这样是可以创建成功,但查看一下建表后的语句,就会发现,mysql把它替换成tinyint(1)。也就是说mysql把boolean=tinyInt了。</wbr></wbr></wbr></wbr>
<wbr></wbr>
<wbr></wbr>
当然,我们在pojo里面,可以直接定义该属性为Boolean
如private Boolean stuStatus; // 学生状态
<wbr></wbr>
<wbr></wbr>
参考博客:http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/08/25/2153011.html
分享到:
相关推荐
Boolean RT资源包,可用于Unity 几何体布尔运算
1- Real-time or per-click Boolean execution. 2- Material, UV and texture preservation. 3- Saving to prefab. 4- Constructive solid Geometry (CSG). 5- Smoothing of Boolean execution to keep smooth frame...
mybatis-generator自动生成工具,包含tinyint处理,自动获取数据库注释
下面小编就为大家带来一篇详谈java中boolean和Boolean的区别。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
下面小编就为大家带来一篇JS字符串false转boolean的方法(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Unity 几何体布尔运算BooleanRT,Boolean RT.unitypackage,unity3d布尔运算插件。
boolean_approach
BooleanRT实时模型网格布尔运算插件 可以进行实时的模型合并、求差集、求交集等操作。 全网最好用的了,没有第二款。
delphi编程里的bool跟boolean类型有什么区别.mht
Screen Space Boolean Subtract Shader 动态计算模型布尔值,源代码
The of Boolean Functions
下面小编就为大家带来一篇Java中Boolean与字符串或者数字1和0的转换实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
saliency detection a boolean map approach
Objective-C Boolean 变量 具体内容,请参考苹果开发者 Mike 的博文http://blog.sina.com.cn/s/blog_7aa21f320100r6ux.html
用作unity3D几何体的布尔运算包用作unity3D几何体的布尔运算包用作unity3D几何体的布尔运算包
This textbook presents a survey of research on boolean functions, circuits, parallel computation models, function algebras, and proof systems. Its main aim is to elucidate the structure of "fast" ...
The Handbook is divided into two ...part (Volume 1) is a completely self-contained treatment of the fundamentals of the subject, which mathematicians in various fields may find interesting and useful.