在我的(Microsoft SQL Server)数据库中,我有一个表,其中有一个类型为money的列。作为类中的注释,我有:
@Column(name = "preis", columnDefinition = "money", nullable=true)
private BigDecimal price;这样做效果很好。但是如何在hbm.xml文件中进行这样的映射呢?
<property name = "price" column = "EPreis" type="big_decimal"/>传递一个错误:
Schema-validation: wrong column type encountered in column ...
found [money (Types#DECIMAL)], but expecting [numeric(19,2) (Types#NUMERIC)]发布于 2018-08-15 19:25:55
尝试在属性定义中添加sql-type="money"。
https://stackoverflow.com/questions/51854600
复制相似问题