title: Hibernate: How to set the length of integer fields
body: <p>I have an entity mapped by hibernate to a MySQL database with some integer fields, e.g.:</p>
  
  <pre><code>@Column(name = "BVE_YEAR", nullable = true, length = 4)
  private Integer year;
  </code></pre>
  
  <p>The tables are created automatically by Hibernate (<code>hibernate.hbm2ddl.auto=create</code>)</p>
  
  <p>All fields of type <code>Integer</code> or <code>int</code> are created with a length of 10, regardless what I specified within the <code>@Column</code> annotation.</p>
  
  <p>How can I set the length of the column (except for some <code>ALTER TABLE</code> script)?</p>
  
  <p>Thanks in advance for any help and ideas</p>