用 hibernate 进行 mysql 连接时,若 mysql 有张带有 bit 数据类型的字段,ex: 
create table aaa ( 
  id int, 
  isDeleted bit ); 此时若往此张表插入数据时,hibernate 会自动生成如下 sql 脚本: 
insert into aaa values(1,  '1 '); 
它会把 bit 型数据加上单引号,hibernate 的配置文件和映射文件检查了的(boolean 和 java.lang.Boolean 都试过了的,不是 String),没有问题。因此会出现 mysql 的语法错误,改怎么解决啊。现 isDeleted 用 bit 是可行的,就两种可能。不需要用 tinyint。有时候 hibernate 为 bit 生成的代码带有单引号,有时候没有,为什么???以后再不敢用 bit 了啊。isAudited='0', isDeleted='1'org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute JDBC batch update; bad SQL grammar [update news set categoryID=?, workermanID=?, title=?, keys=?, attribute=?, content=?, clicks=?, isAudited=?, isDeleted=? where id=?]; nested exception is java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys='k', attribute='hot', content='c', clicks=100, isAudited='0', isDeleted='1'' at line 1
java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys='k', attribute='hot', content='c', clicks=100, isAudited='0', isDeleted='1'' at line 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:896)