-->
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.  [ 3 posts ] 
Author Message
 Post subject: Question about Oracle9Dialect and sql-type="binary([>
PostPosted: Wed Jun 16, 2004 7:38 am 
Newbie

Joined: Wed Jun 16, 2004 5:53 am
Posts: 4
Hi,

Using Hibernate 2.1.4 to create schema from a mapping document containing :
Code:
<property name="cert" type="binary" not-null="false" length="1500">
</property>
<property name="pkcs" type="binary" not-null="false" length="6000">
</property>


with the Oracle9Dialect results in a SQL create statement like :
Code:
create table xxx(
   ...
   cert LONG RAW,
   pkcs LONG RAW,
   ...)


Which fails because Oracle does not support more than 1 LONG column.
However, I believe Oracle supports up to 2000 bytes per RAW column, so why does the Dialect map my first property (cert, with a length of 1500) to LONG RAW when RAW(1500) would be better?

I looked at the Oracle9Dialect class, and changing line 31 from :
Code:
registerColumnType( Types.VARBINARY, 255, "RAW($l)" );

to:
Code:
registerColumnType( Types.VARBINARY, 2000, "RAW($l)" );

this fixed the problem, and the schema was generated with the RAW(1500) and ran correctly against the DB.

Is there a reason for not allowing RAWs longer than 255 bytes in the Oracle9Dialect?

I am trying to store 2 byte arrays in one table, is there a better approach than type="binary"? I'd rather not base64 encode them and then store as strings....

regards,
Brett


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 16, 2004 10:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
I think its just that none of us have been able to test against 9i. I know 8i very well, but not 9i. This must have been something that changed as 8i would only allow RAW columns to have a length of 255.

Open a jira case.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 17, 2004 4:11 am 
Newbie

Joined: Wed Jun 16, 2004 5:53 am
Posts: 4
Thanks, will do.


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