-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate BLOB/CLOB Support with MySQL
PostPosted: Mon Aug 04, 2008 6:42 pm 
Newbie

Joined: Mon Aug 04, 2008 6:00 pm
Posts: 2
I'm relatively new to hibernate and am in the process on trying to ramp up to fill the void left by someone else leaving an existent project. I've been searching the forums and documents to try to help me with what I believe to be a relatively simple problem. Unfortunately I'm not able to find an answer, but I've seen a couple threads of people asking the same question on various forums (including this one) without reply.

It would be a great help to me if somebody could point me in the right direction to try to figure out the problem I am having.

I get the following errors in my schema export when I run it....

[schemaexport] SEVERE: Unsuccessful: create index cpmParamValueIdx on ClobPropMap (paramValue)
[schemaexport] SEVERE: BLOB/TEXT column 'paramValue' used in key specification without a key length

My hibernate XML file defines the that variable as follows:

<map name="clobProps" table="ClobPropMap" lazy="false" cascade="all">
<key column="objectId" />
<map-key column="paramName" type="string" />
<element type="text" length="10000">
<column name="paramValue" index="cpmParamValueIdx" />
</element>
</map>

Hibernate is wrapping MySQL at the moment, but I hoping to use it to wrap other things in the future. The only solution I've seen is here: http://forum.hibernate.org/viewtopic.ph ... key+length but this solution is less than desirable as it is MySQL specific and very inelegant, doing a regex find-replace on a generated file to add CLOB/BLOB specific typing.

Can anyone point me in the right direction for how to define CLOB/BLOB fields in Hibernate? What is the correct syntax for using type="text" with a length field?

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2008 1:08 pm 
Newbie

Joined: Mon Aug 04, 2008 6:00 pm
Posts: 2
I've been doing some more research on this but could still use some help.

I think the problem might have to do with the index="cpmParamValueIdx" line as part of the column name definition.

Any thoughts or directions that might help me out?


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