I'm using Oracle XE database and annotation driven mapping. What column type should I choose for BigInteger
value mapping in Hibernate?
If you will see documentation it already mentioned
big_decimal, big_integer
Type mappings from java.math.BigDecimal and java.math.BigInteger to NUMERIC (or Oracle NUMBER).
here is an example which i got from Hibernate community
Hibernate 3.1.1 with Oracle 10g and XE. The script of my Table sample is this:
CREATE sample (
sampa NUMBER,
sampb NUMBER(5),
sampc NUMBER(10),
sampd NUMBER(15,2),
sampe NUMBER(19,7)
);
and corresponding
<property name="sampa" column="sampa" type="java.math.BigInteger"/>
<property name="sampb" column="sampb" type="java.math.BigInteger"/>
<property name="sampc" column="sampc" type="java.math.BigInteger"/>
<property name="sampd" column="sampd" type="java.math.BigDecimal" precision="15" scale="2"/>
<property name="sampe" column="sampe" type="java.math.BigDecimal" precision="19" scale="7"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With