aspose file tools*
The moose likes JDBC and the fly likes SQL server Big Decimal small money hibernate question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL server Big Decimal small money hibernate question" Watch "SQL server Big Decimal small money hibernate question" New topic
Author

SQL server Big Decimal small money hibernate question

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
I have a table which has a column advanced_payment which is sql server small money.

In my java code I have

@Column(name="advanced_payment")
private BigDecimal advancedPayment;

This calls the following hibernateException


Caused by: org.hibernate.HibernateException: Wrong column type in Enterprise.dbo.pws_price_profile for column advanced_payment. Found:
smallmoney, expected: numeric(19,2).

numeric(19,2) is BigDecimal in Oracle. SQL Server maps Big Decimal to small money.

So is this a hibernate problem.

Thanks for any help

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
Fixed I added @Column(name="advanced_payment",columnDefinition="smallmoney")
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL server Big Decimal small money hibernate question