title: Hibernate + MySQL custom boolean type
body: <p>Hibernate tool generate <code>tinyint(1)</code> to boolean type in javacode. with default value: 0 false, 1 true</p>
  
  <p>But i want to change 1: false and 0: true.</p>
  
  <p>How i can do it?</p>
  
  <p>I have added <code>&lt;prop key="hibernate.query.substitutions"&gt;true 0, false 1&lt;/prop&gt;</code> in my datasource.xml but it still not work. </p>
  
  <pre><code>&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;!-- Read database connection from data source --&gt;
      &lt;property name="dataSource"&gt;
          &lt;ref bean="dataSource" /&gt;
      &lt;/property&gt;
      &lt;!-- Config hibernate properties --&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
              &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
              &lt;!-- Minimum number of JDBC connections in the pool. Hibernate default: 1 --&gt;
              &lt;prop key="hibernate.c3p0.min_size"&gt;5&lt;/prop&gt;
              &lt;!-- Maximum number of JDBC connections in the pool. Hibernate default: 100 --&gt;
              &lt;prop key="hibernate.c3p0.max_size"&gt;20&lt;/prop&gt;
              &lt;!-- When an idle connection is removed from the pool (in second). Hibernate default: 0, never expire. --&gt;
              &lt;prop key="hibernate.c3p0.timeout"&gt;300&lt;/prop&gt;
              &lt;!-- Number of prepared statements will be cached. Increase performance. Hibernate default: 0 , caching is disable. --&gt;
              &lt;prop key="hibernate.c3p0.max_statements"&gt;50&lt;/prop&gt;
              &lt;!-- Hibernate.c3p0.idle_test_period – idle time in seconds before a connection is automatically validated. Hibernate default: 0 --&gt;
              &lt;prop key="hibernate.c3p0.idle_test_period"&gt;3000&lt;/prop&gt;
              &lt;prop key="hibernate.query.substitutions"&gt;true 0, false 1&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>Please help me out, thank you!</p>