-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping question between int and Decimal(x,0)
PostPosted: Tue Nov 22, 2005 12:56 pm 
Newbie

Joined: Mon Oct 17, 2005 2:55 pm
Posts: 5
Location: Toronto, Canada
Hi, there.

As a newbie in Hibernate, I face a pretty confusing issue now.

In my domain object there's a property of which type is 'int'.
The DB table column that correspons to the property has Decimal(5,0) for example. What would be the best way to convert between these two different types?

Supposed that no changes on any of each side will be possible.

In my thought, I have several guesses.

1. HBM supports this in nature?
2. UserType will be required?
3. PrimitiveType is the one?
... etc.

Please share your knowledge for me, Thanks a lot.

Brendan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 3:08 pm 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Brendan,

For decimal(x,y) I use Float and it works just fine. My database is Firebird. Try changing "int" to "Float".

C ya.

_________________
Don't forget to rate if the post helped!


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

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.