title: Mapping a boolean with hibernate
body: <p>I'm running into trouble with hibernate. I recently set my hbm2ddl to validate, and it has been complaining a lot about wrong datatypes. I have fixed every problem except for booleans.</p>
  
  <p>I have a field <code>opener</code> in my class, which is mapped as: </p>
  
  <pre><code>&lt;property column="opener" name="opener" type="boolean"/&gt;
  </code></pre>
  
  <p>The column <code>opener</code> is a <code>tinyint (4)</code> and has a value of 1 or 0. So far I've tried changing the types, but to no avail. I have also tried using the following setting in my hibernate.cfg: </p>
  
  <pre><code>&lt;property name="hibernate.query.substitutions"&gt;true 1, false 0&lt;/property&gt;
  </code></pre>
  
  <p>But I am still getting the same error. What am I doing wrong?</p>
  
  <pre><code>org.hibernate.HibernateException: Wrong column type: opener, expected: bit
      at org.hibernate.mapping.Table.validateColumns(Table.java:261)
      at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
      at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
      at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:317)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
      at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
  </code></pre>
  
  <p>note: I have no access to the database.</p>