-->
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.  [ 9 posts ] 
Author Message
 Post subject: controlling type-definition (short/long)
PostPosted: Tue Aug 30, 2005 3:00 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
I need to habe long types (fully qualified classname) instead of short-name.
How can I control this?
Specifiy it in cfg.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 3:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 3:34 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
max wrote:
huh ?


I need not type="long"

I need type="java.lang.Long"

Also, I need to have a custom type-mapping:
oracle:number should map to java.lang.Double, not to BigDecimal

What is best practise to specify this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 3:37 am 
Hibernate Team
Hibernate Team

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

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 4:08 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
what I see from the docs is

<type-mapping>
<sql-type jdbc-type="VARCHAR" length='20' hibernate-type="SomeUserType" /> <!-- jdbc-type is name fom java.sql.Types -->
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="yes_no" />
<sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="boolean" /> <!-- length, scale and precision can be used to specify the mapping precisly -->
<sql-type jdbc-type="NUMERIC" hibernate-type="long" /> <!-- the type-mappings are ordered. This mapping will be consulted last, thus overriden by the previous one if precision=1 for the column -->
</type-mapping>

is there a DTD for this, perhaps even documented?
I can't see any way here to specify long types (fully qualified class names).


max wrote:
in reveng.xml


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 4:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate-type="java.lang.Long" ? that is how you normally do it.

and yes there is a dtd for it - hibernate-reverseengineering.dtd

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 7:43 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
ah great - I think you added it just now.

max wrote:
hibernate-type="java.lang.Long" ? that is how you normally do it.

and yes there is a dtd for it - hibernate-reverseengineering.dtd


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 8:25 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
err - somehow it won't work. what's wrong in this config:

<type-mapping>
<sql-type jdbc-type="NUMERIC" length="8" scale="2" hibernate-type="java.lang.Long" />
</type-mapping>

error appears:

org.hibernate.MappingException:Could not configure overrides from file: ... reveng.xml



max wrote:
hibernate-type="java.lang.Long" ? that is how you normally do it.

and yes there is a dtd for it - hibernate-reverseengineering.dtd


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look in your stacktrace - it will state what part of the xml it doesnt like ...

_________________
Max
Don't forget to rate


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