Thread:
 Need help using StringClobType 
 derrill   08 Jul 2005, 00:58 
 Re: Need help using StringClobType 
 derrill   08 Jul 2005, 14:22 
 Re: Need help using StringClobType 
 jjrobert   07 Sep 2005, 11:52 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: derrill (08 Jul 2005, 00:58) Replies: 2, Views: 39840
Subject: Need help using StringClobType
Hi, 

This might be a stupid question but...

I trying to use the solution entitled “Updated Clobs handling for Oracle
and Hibernate” on the main wiki. 
My main concern is I'm not entirely sure how to use the StringClobType.
 (I think the real issue, is I'm not sure how to use UserTypes, but I've
been unable to really find any good examples for doing this!) 

Here's some pseudocode of what I am *trying* to do:

suppose I want to load a row that has a clob column and i want to change
it and then save it:
MyEntity obj = session.load(MyEntity.class, <primarykey>);
StringClobType stringClob = obj.getMyClobProperty();
//// At this point how am I going to get or change the contents of
stringClob ????
obj.setMyClobProperty(stringClob);
session.update(obj);

suppose I want instantiate a new row, and save my clob:
StringClobType newClob = ?????; /// at this point how am i going to
instantiate a new StringClobType
MyEntity obj = new MyEntity(..., ..., ...newClob)
session.save(obj);

Derrill

PS It's also quite confusing that there are a lot of different solutions
and the comments say they have more solutions and that the posted ones
are flawed...
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]