title: "Found: bit, expected: boolean" after Hibernate 4 upgrade
body: <p>I'm trying to upgrade from Hibernate 3.6.5 to 4.0 (and from Spring 3.0.5 to 3.1 which is required for Hibernate 4 support).</p>
  
  <p>Now, with both MySQL and HSQL, I'm running into this problem with persistent boolean fields:</p>
  
  <pre><code>Caused by: org.hibernate.HibernateException: 
  Wrong column type in PUBLIC.PUBLIC.EVENT for column Checked. Found: bit, expected: boolean
      at org.hibernate.mapping.Table.validateColumns(Table.java:282)
      at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1268)
      at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:453)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
      at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:184)
      at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:314)
  </code></pre>
  
  <p>JPA <a href="http://docs.oracle.com/javaee/6/api/javax/persistence/Entity.html"><code>@Entity</code></a> and <a href="http://docs.oracle.com/javaee/6/api/javax/persistence/Column.html"><code>@Column</code></a> annotations are used in domain objects, and the problematic fields look like this:</p>
  
  <pre><code>@Column(name = "Checked")
  private boolean checked;
  </code></pre>
  
  <p>HSQL schema:</p>
  
  <pre><code>Checked bit default 0 not null,
  </code></pre>
  
  <p>MySQL schema:</p>
  
  <pre><code>`Checked` tinyint(1) NOT NULL default '0',
  </code></pre>
  
  <p><strong>What is the most straightforward way to solve this while sticking with Hibernate 4</strong>? Should I change the database schema, Hibernate configs, or domain class annotations?</p>
  
  <p>I have no idea if the code and configuration was fully "correct" before, but at least it worked fine with Hibernate 3.</p>