nIx..
nIx..

Reputation: 370

Hibernate decimal(20,3) mapping failing

I want to create a decimal column with precision 20 and scale 3 in a table, What i did is:

  1. create following variable in pojo class

    private BigDecimal  minimumValue;
    
  2. In .hbm file i am setting property value as

    <property name="minimumValue" type="DECIMAL" precision="20" scale="3"/>
    

I am getting following error:

org.hibernate.MappingException: Could not determine type for: DECIMAL, at table: TEST_DECIMAL, for columns: [org.hibernate.mapping.Column(minimumValue)]

Any suggestions?

Upvotes: 3

Views: 11114

Answers (1)

Luca Basso Ricci
Luca Basso Ricci

Reputation: 18423

Remove type="DECIMAL".
The type attribute holds the hibernate mapping type, this mapping types will convert from Java to SQL data type. In your case you can use type="big_decimal".

Upvotes: 7

Related Questions