-->
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: Sql Blob type problem
PostPosted: Sun Oct 31, 2004 8:47 pm 
Regular
Regular

Joined: Mon Aug 02, 2004 9:33 am
Posts: 69
Hibernate version:2.1.6

Mapping documents:
<property
name="description"
type="blob"
column="DESCRIPTION"
/>


Name and version of the database you are using:mysql 4

Full stack trace of any exception that occurs:

[junit] null
[junit] java.lang.ClassCastException
[junit] at net.sf.hibernate.type.BlobType.set(BlobType.java:27)
[junit] at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
[junit] at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
[junit] at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393)
[junit] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
[junit] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
[junit] at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
[junit] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
[junit] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)
[junit] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
[junit] at org.springframework.orm.hibernate.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:214)
[junit] at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:177)
[junit] at org.springframework.orm.hibernate.HibernateTemplate.save(HibernateTemplate.java:298)
[junit] at catalog.model.dao.hibernate.PostingDaoHibernateImpl.savePostingIdentification(PostingDaoHibernateImpl.java:28)
[junit] at catalog.model.dao.PostingDAOTest.testAddAndRemoveAndUpdatePosting(PostingDAOTest.java:131)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


Debug level Hibernate log excerpt:

Persistent class:
/**
* @return Returns the description.
* @hibernate.property column="DESCRIPTION" type="blob"
*/
public String getDescription() {
return description;
}

Hi guys,

I was trying to to save a String object into Blob type column in MySql 4 and got exception. Pls help.....Thanks !!

regards,
prettyhandling


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.