• Post Reply Bookmark Topic Watch Topic
  • New Topic

precision in mapping a table to an object

 
Elinor Chang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens of I map a 16 long number to a 9 long BigDecimal in Hibernate as the following:

Table definition

RATE_TOT DECIMAL(16,14),

Hiberate config

<property
name="rateTot"
type="java.math.BigDecimal"
column="RATE_TOT"
length="9"
>
<meta attribute="field-description">
@hibernate.property
column="RATE_TOT"
length="9"
</meta>
</property>

The RATE_TOT is a 16 long numeric field but in mapping file it's declared as 9 long. What happens to those additional 7 digits?

Thanks
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!