-->
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.  [ 6 posts ] 
Author Message
 Post subject: Class cast exception with <any>
PostPosted: Thu Apr 15, 2004 11:44 am 
Beginner
Beginner

Joined: Fri Feb 27, 2004 11:47 am
Posts: 24
I am having problems with the mapping


<any name="parent" id-type="int" meta-type="string" >
<meta-value value="ORGANIZATION123" class="model.Organization"/>
<column name="SUBJECT_ENTITY_NAME"/>
<column name="SUBJECT_ENTITY_ID"/>
</any>


could you please explain why I am getting class cast extception from meta-type. and if I remove meta-type, it inserts value but for SUBJECT_ENTITY_NAME it enters full qualified class name "model.Organization". How can I make it to enter value="ORGANIZATION123"

_________________
Web Developer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 12:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Exception stack trace?


Top
 Profile  
 
 Post subject: the exception: by using : meta-type="string">
PostPosted: Thu Apr 15, 2004 1:48 pm 
Beginner
Beginner

Joined: Fri Feb 27, 2004 11:47 am
Posts: 24
Here is the exception: by using : meta-type="string">


java.lang.ClassCastException
at net.sf.hibernate.type.StringType.toString(StringType.java:47)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.type.ObjectType.nullSafeSet(ObjectType.java:143)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.
java:394)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.jav
a:512)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.jav
a:489)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.j
ava:28)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2306)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.j

_________________
Web Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 6:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is bizarre!

Are you really using Hibernate 2.1.2?

ObjectType should be calling MetaType, not StringType...

I do not understand how this can occur - it seems as if the <meta-value> is not even there!


Top
 Profile  
 
 Post subject: Hibernate 2.1.2 solves the problem
PostPosted: Fri Apr 16, 2004 10:29 am 
Beginner
Beginner

Joined: Fri Feb 27, 2004 11:47 am
Posts: 24
Thanks Hibernate2.1.2 solves it I was using old one,

_________________
Web Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 10:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Actually, the feature did not exist in "the old one"....


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