-->
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.  [ 5 posts ] 
Author Message
 Post subject: Oracle TIMESTAMP and BLOB return OTHER in reveng config
PostPosted: Thu Mar 02, 2006 8:40 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
Hi,

it's me again. I'm working with Oracle 10g and noticed that the TIMESTAMP data type and BLOB is returned as OTHER in the reverse engineering config. I tried to differ both fields with length, scale or precision, but as soon as I have two JDBC types "OTHER" in my hibernate.reveng.xml the data type in my Java class is java.io.Serializable and not the one specified in my reveng-file. If there is just one "OTHER" in my hibernate.reveng.xml it's correctly mappepd e.g. to java.util.Date; but of course I do not want BLOB mapped to java.util.Date.

Any workaround for this?

Rgds,
Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 8:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmmm....maybe a good usecase for me to actually add db-specific mappings.

how does your reveng.xml file look like ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 9:21 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
max wrote:
how does your reveng.xml file look like ?


I can't reproduce the error any more that both types are mapped to java.io.Serializable. :-( Now both types are mapped to Date or Blob.

This is the working one which maps TIMESTAMP to java.util.Date but also BLOB to java.util.Date.

Code:
<hibernate-reverse-engineering>
<type-mapping>
   <sql-type jdbc-type="TIMESTAMP" hibernate-type="java.util.Date" />
   <sql-type jdbc-type="DATE" hibernate-type="java.util.Date" />
   <sql-type jdbc-type="TIME" hibernate-type="java.util.Date" />
   <sql-type jdbc-type="OTHER" hibernate-type="java.util.Date"
      not-null="false"/>
   <sql-type jdbc-type="CHAR" hibernate-type="java.lang.Boolean"
      length="1" />
   <sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Integer"
      not-null="true" precision="8" />
   <sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Long"
      not-null="true" precision="12" />
   <sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Long"
      precision="10" not-null="true" />
   <sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Long"
      precision="12" not-null="false" />
</type-mapping>
</hibernate-reverse-engineering>


If I add this
Code:
<sql-type jdbc-type="OTHER" hibernate-type="java.sql.Blob" not-null="false" length="4000"/>


it seems that the length attribute is ignored for "OTHER" types, which is comprehensible.

So the java.io.Serializable error seems to be my fault. If I can reproduce it again, I will post it here. But maybe you have an idea how to differ between two "OTHER" types.

Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 11:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it very much depend what the driver returns for the values - try and enable logging and let me know ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 12:25 pm 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
Great, it seems to be a driver issue. I wondered that in my reveng strategy sqlType: 1111 was returned for both columns. Squirrel, my SQL client, showed the types correctly. I then replaced ojbc14.jar in my project with the one from my Squirrel directory. After I restarted eclipse the reveng xml editor showed the types correctly. I think generation will now work too. I hate Oracle for providing totaly different drivers with exactly the same name. :-(

_________________
You'll never get a second chance to make a first impression!


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