-->
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.  [ 4 posts ] 
Author Message
 Post subject: session.delete() - classCast Exception
PostPosted: Mon May 15, 2006 11:22 am 
Newbie

Joined: Tue Sep 27, 2005 4:07 pm
Posts: 7
I don't understand where is my problem with this code :

I want to do that :

Code:
sessionHib.delete("from TUser user where user.UserInstitutionId = '10'");


And i have this error message :

Quote:
java.lang.ClassCastException
at net.sf.hibernate.type.IntegerType.set(IntegerType.java:31)


I know that UserInstitutionId is integer, but what's the matter with that ?

Thanks for your help !


Hibernate version: 2


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 1:33 pm 
Regular
Regular

Joined: Thu Jan 29, 2004 10:34 am
Posts: 52
Location: Austin, TX
did you try without the single quotes in '10'


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 2:19 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
try using one of the setParameter methods and let the PreparedStatement class handle it

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 16, 2006 4:47 am 
Newbie

Joined: Tue Sep 27, 2005 4:07 pm
Posts: 7
I have the same problem without the single quotes ...

kochcp : i don't know Hibernate very well, i'm sorry ... What are you talking about ? setparameter ?


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