-->
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: why does type=Integer map to number(10,0)?
PostPosted: Wed Sep 01, 2004 2:36 pm 
Newbie

Joined: Tue Jul 27, 2004 1:17 pm
Posts: 12
I want my schema to have Integer fields but I get "number(10,0)" instead.
I'm using Oracle9Dialect.

Thank you.

Hibernate version:2.1

Mapping documents:
<hibernate-mapping>
<class name="foo" table="foo">

<id name="id" column="id"type="java.lang.Integer" >
<generator class="increment"> </generator>
</id>

<property name="matchingEventId" type="java.lang.Integer"
update="true" insert="true"
access="property" column="matchingEventId" />
</class>

</hibernate-mapping>


I get this in my schema_export.sql:

create table foo (
id NUMBER(10,0) not null,
matchingEventId NUMBER(10,0),
)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 01, 2004 2:43 pm 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
All Oracle integer fields are described as number( x ) in the db where x is the number of digits required by the type.

Integer is number( 10 )
Long is number( 19 )

The second optional number is the number of decimal places the number has which is zero for ints/longs etc.


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.