-->
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: how to map String array to Clob
PostPosted: Mon Dec 20, 2004 5:56 pm 
Newbie

Joined: Sun Nov 07, 2004 9:58 pm
Posts: 6
Iam trying to map String array to table of column type Clob. Iam using following XDoclet.
* @hibernate.array table="ITEM_DATA" cascade="all"
* @hibernate.collection-index column="DATA_IDX"
* @hibernate.collection-key column="DATA_ID"
* @hibernate.collection-element column="DATA" type="java.sql.Clob"

is there anything wrong with this mapping. Iam getting following exception.
java.lang.ClassCastException
at net.sf.hibernate.type.ClobType.set(ClobType.java:27)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.collection.AbstractCollectionPersister.writeElement(
AbstractCollectionPersister.java:384)
at net.sf.hibernate.collection.ArrayHolder.writeTo(ArrayHolder.java:112)

at net.sf.hibernate.collection.AbstractCollectionPersister.recreate(Abst
ractCollectionPersister.java:523)
at net.sf.hibernate.impl.ScheduledCollectionRecreate.execute(ScheduledCo
llectionRecreate.java:23)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2375)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
at net.sf.hibernate.transaction.JTATransaction.commit(JTATransaction.jav
a:52)

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]
* @hibernate.array table="ITEM_DATA" cascade="all"
* @hibernate.collection-index column="DATA_IDX"
* @hibernate.collection-key column="DATA_ID"
* @hibernate.collection-element column="DATA" type="java.sql.Clob"
[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 6:17 am 
Newbie

Joined: Tue Nov 08, 2005 7:48 am
Posts: 5
Did you find a solution to this problem? I might want to use something similar. If not I could always turn the String Array into a collection of simple POJO's.


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.