-->
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.  [ 1 post ] 
Author Message
 Post subject: Oracle Lobs and Hibernate (nth time...)
PostPosted: Mon Oct 27, 2008 9:38 am 
Newbie

Joined: Mon Jul 05, 2004 5:20 pm
Posts: 11
Hi,

I'm using Hibernate 3.3 and Oracle 10g and I'm having two similar problems when working with lobs.

First with a simple Lob property in the DB I can't automatically translate it to String in my Java code. I am using annotations and would like to avoid the use of XML config files. Is there any one-stop place for solving this? I've been looking around different places and even the documents in this site seem to be outdated. I tried Springs lobhandler but I am getting an exception:

"getclob not implemented for class oracle.jdbc.driver.T4VarcharAccessor"

I will also be needing to map a Map<String, String> where the values are Blobs as well.

Any hints will be greatly appreciated. I am using Oracle's latest jdbc drivers. (and Oracle XE).

I was wondering as well if there is any way to specify that my blob column should be returned as utl_raw.cast_to_varchar2(MY_COLUMN) and inserted as utl_raw.cast_to_raw(MY_COLUMN) . This would be the easiest way to handle lobs to me.

Without the LobHandler and that stuff I can successfully get the Lob value, but as a String representing the Hex values of the field.
For if I stored a "V" as UTF-8, hibernate returns the String "56", since 0x56 is the V character. I could eventually parse that string, convert it as double bytes and create a new UTF8 string out of it, but since this column will be read a LOT I'm afraid this could slow down my app.

Any thoughts?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.