title: how to define char(2) column in hibernate hbm.xml?
body: <p>Hi must modify some hibernate legacy code and I should define a SQL char(2) column (foreign key to a char(2) primary key).</p>
  
  <p>My definition file contains:</p>
  
  <pre><code>    &lt;property
          name="language"
          type="char"
          update="true"
          insert="true"
          column="LANGUAGE"
          length="2"
      /&gt;
  </code></pre>
  
  <p>but hibernate generates:</p>
  
  <pre><code>+---------------------+--------------+------+-----+---------+----------------+
  | Field               | Type         | Null | Key | Default | Extra          |
  +---------------------+--------------+------+-----+---------+----------------+
  (...)
  | LANGUAGE            | char(1)      | YES  |     | NULL    |                |    
  +---------------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>The foreign key table is something like:</p>
  
  <pre><code>+--------------+--------------+------+-----+---------+-------+
  | Field        | Type         | Null | Key | Default | Extra |
  +--------------+--------------+------+-----+---------+-------+
  | LANGUAGE     | char(2)      | NO   | PRI | NULL    |       |
  (...)
  +--------------+--------------+------+-----+---------+-------+
  </code></pre>
  
  <p>Using:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;3.3.1.GA&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>