Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL server Big Decimal small money hibernate question

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed I added @Column(name="advanced_payment",columnDefinition="smallmoney")
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic