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?
|