-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Precision and Scale mapping
PostPosted: Tue Dec 12, 2006 8:07 pm 
Newbie

Joined: Tue Dec 12, 2006 7:16 pm
Posts: 2
[b]Hibernate version:[/b] 3.2.1

The Oracle9Dialect always maps the float java type to the FLOAT database type, so any precision or scale information specified in the mapping file is lost.

If this is overridden to map to NUMBER($p,$s), then the precision and scale are mapped into the database correctly, but if none are specified then a default scale of 2 is inserted, which might also cause unexpected problems.

Would it be a useful enhancement for hibernate if numeric types could have multiple mappings depending on whether precision/scale are specified in the mapping file?

For example, the following property (with a java type of float) would map to a FLOAT database column, as is the current situation:
<property name="Area" />

But the following property, instead of also mapping to FLOAT, would map to NUMBER(10,3):
<property name="Area" precision="10" scale="3"/>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.