-->
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.  [ 14 posts ] 
Author Message
 Post subject: how to map oracle type "FLOAT"
PostPosted: Wed Aug 17, 2005 11:48 pm 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

hello
I'm using oracle 9 , hibernate 3.0.5 and eclipse 3.1

I use FLOAT type in a field and mapping with Hibernate tools 3.0 alpha 4 and also mapping the sql type in hibernate.reveng.xml, but this tools mapping FLOAT to java.lang.Object not the type java.lang.Double that I setting in <sql-type ......> .

After I checking html files that generat by this tools I found the SqlType field is N/D . why?

how can i map the FLOAT to java.lang.Double or just long ? any one knows?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 2:57 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
I'm having exactly the same problem but not just with float. I'd greteful if somebody resolved this.

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 3:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
show the reveng.xml file please

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 3:59 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
max wrote:
show the reveng.xml file please


<hibernate-reverse-engineering>
<type-mapping>
<sql-type jdbc-type="FLOAT" hibernate-type="java.lang.Double" />
</type-mapping>
<table-filter match-schema="DEMO" match-name=".*" />
<table-filter match-schema=".*" match-name=".*" exclude="true"/>
</hibernate-reverse-engineering>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in alpha4 you need to specify a length, precision or scale.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:24 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
max wrote:
in alpha4 you need to specify a length, precision or scale.


I change <sql-type jdbc-type="FLOAT" hibernate-type="java.lang.Double" />
to
<sql-type jdbc-type="FLOAT" length="10" hibernate-type="java.lang.Double" /> is that right?

it`s still not work

if this change is not properly,please give some advise.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:27 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
And, I also checking the html file generated by the tool, its report that the sqlType of "FLOAT" type field is N/D, why?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
What is N/D ?

a float has precision/scale - not a length AFAIK ;)

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:12 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
max wrote:
What is N/D ?

a float has precision/scale - not a length AFAIK ;)

/max


I use
Code:
precision="10"
instead of
Code:
length="10"
but it still not work.

And I dont know the means of "N/D" because it generated by HibernateTool. I guess when it try to get metaData from database, the tool cannot parse the response for the "FLOAT" type so it told me "N/D".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how and where do you see N/D ? Never seen that - so please show me the generated mapping.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:28 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
max wrote:
how and where do you see N/D ? Never seen that - so please show me the generated mapping.


For Hibernate tools 3.0 alpha 4, it can generate some .html file descripe the schema info from Hibernate Artifact Generation command in eclipse. so I have a html file for each table . In these html file ,a sheet created to describe the table`s information, this sheet include some field named Name,SqlType,Length,Precision etc. the sting of "N/D" appear in the SqlType field .


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:30 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
the generated mapping for "FLOAT" field is
Code:
        <property name="depotLevel" type="java.lang.Object">
            <column name="DEPOT_LEVEL" not-null="true" />
        </property>



Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 8:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ah - the N/D is just "Not determinable" since its not recorded in the mappings...

if you can, please try out with the current cvs version - should work better there.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 9:21 am 
Newbie

Joined: Wed Aug 17, 2005 11:19 pm
Posts: 11
max wrote:
ah - the N/D is just "Not determinable" since its not recorded in the mappings...

if you can, please try out with the current cvs version - should work better there.


OK max, think you so much !


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 14 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.