I want to map an Oracle Table to a Java entity i create. In the Oracle table, i have :
- a field called A of type NUMBER(6,3)
- a field called B of type NUMBER(6, 0)
For the attribute in the Java entity corresponding to the field called A, must i have a BigDecimal (or a Float is sufficient) ? must i have with @Column (precision = 6, scale = 2) ?
I find maybe the BigDecimal a little heavy but if it is necessary, i will use it. I will in the future maybe use this entity to create table for my unitary tests with H2 (DDL). Maybe but for now, no DDL.
For the attribute in the Java entity corresponding to the field called B, is an attribute of type Integer (or int) sufficient ?
Thank you in advance for your answer. Thomas
CodePudding user response:
- BigDecimal since it's better to use BigDecimal than Float/Double for arithmetic operations.
- Integer will be fine.