title: Entity Class with BigDecimal and not Long - Hibernate tools generated
body: <p>Entity Class with BigDecimal and not Long</p>
  
  <p>My entity classes are gereneated with Hibernate tools. Unfortunately some 'long' values become 'BigDecimal' numbers (Column: AGE, BIRTHDATE), but not all of them (Column: ID)!</p>
  
  <p>Why is this happening and how should I fix this?</p>
  
  <p>A table in my Oracle database: User</p>
  
  <pre><code>    Column    -   Type   - Decimal Digits - Column Sizes
      ----------+----------+----------------+-------------
      ID        - NUMBER   -     0          - 10
      AGE       - NUMBER   -     0          - 38
      BIRTHDATE - NUMBER   -     0          - 38
      FIRSTNAME - VARCHAR2 -   &lt;null&gt;       - 32
  </code></pre>
  
  <p>Using Hibernate Tools to generate Entity Classes (POJO)</p>
  
  <pre><code>@Id
  @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
  private long id;
  
  @Column(name = "AGE", precision = 38, scale = 0)
  private BigDecimal age;
  
  @Column(name = "BIRTHDATE", precision = 38, scale = 0)
  private BigDecimal birthdate;
  
  @Column(name = "FIRSTNAME", length = 32)
  private String firstname;
  </code></pre>
  
  <p>Thanks!</p>