我应该在 Hibernate 中使用哪种列类型进行 BigInteger 映射?

What column type should I use for BigInteger mapping in Hibernate?

我正在使用 Oracle XE 数据库和注释驱动的映射。我应该为 Hibernate 中的 BigInteger 值映射选择什么列类型?

如果你会看到 documentation 它已经提到

big_decimal, big_integer

Type mappings from java.math.BigDecimal and java.math.BigInteger to NUMERIC (or Oracle NUMBER).

这是我从 Hibernate 社区得到的一个例子

带有 Oracle 10g 和 XE 的 Hibernate 3.1.1。我的 Table 样本的脚本是这样的:

CREATE sample (
sampa NUMBER,
sampb NUMBER(5),
sampc NUMBER(10),
sampd NUMBER(15,2),
sampe NUMBER(19,7)
); 

和相应的

<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"/>