annotation boolean

来源:互联网 发布:ecshop 打印sql语句 编辑:程序博客网 时间:2024/06/03 16:20

As @Arthur said it maps to Number(1) which would be the standard sql bit where 0 == false and 1 == true. As an alternative you can map char(1) to 'T' or 'F' like this

@org.hibernate.annotations.Type(type="true_false")@NotNullboolean myBoolean;

or map it to 'Y' or 'N'

@org.hibernate.annotations.Type(type="yes_no")@NotNullboolean myBoolean;
0 0
原创粉丝点击