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: Java reflection invoke on Restrictions.in fails...
PostPosted: Thu Oct 04, 2007 10:41 am 
Newbie

Joined: Thu Oct 04, 2007 10:32 am
Posts: 6
Hi,
i'm trying to finish a code that builds dynamically a Criteria object.
I got stuck at the in method of Restrictions.
Here is what i try to do:
return (SimpleExpression) findMethod(criteriaRestriction, restrictionOp, restrictionOpParamTypes).invoke(null, "id", new Object[] {1,2});

The method is found correctly, but when it is invoked, it fails with the following error:

java.lang.ClassCastException: org.hibernate.criterion.InExpression

That's the only info i got :(

Anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 04, 2007 11:22 am 
Newbie

Joined: Thu Oct 04, 2007 10:32 am
Posts: 6
Problem solved!
Sorry for this, i forgot that the in method does return a Criterion object, instead of SimpleExpression, which i was casting to.
The exception is because of the insuitable cast.


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.