-->
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.  [ 7 posts ] 
Author Message
 Post subject: MissimgMethodException
PostPosted: Thu Dec 22, 2005 1:32 pm 
Newbie

Joined: Thu Sep 01, 2005 3:55 pm
Posts: 11
I get this exception after I upgraded to NHibernate 1.01:

MissingMethodException: Method not found: NHibernate.Expression.SimpleExpression NHibernate.Expression.Expression.Eq(System.String, System.Object)

My query looks like this

IList users = session.CreateCriteria(typeof(User)).Add(NHibernate.Expression.Expression.Eq("email", this.txtForgotten.Text)).List();

Does anyone see anything obviously wrong with this query?

_________________
~Dave Foderick


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 22, 2005 5:19 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Which version did you upgrade from? Did you recompile your code?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 12:51 pm 
Newbie

Joined: Thu Sep 01, 2005 3:55 pm
Posts: 11
I upgraded from 0.7 and rebuilt the web site. I'll try to recreate the exception locally and debug it.

Thanks.

_________________
~Dave Foderick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 1:01 pm 
Newbie

Joined: Thu Sep 01, 2005 3:55 pm
Posts: 11
I upgraded from 0.7 and rebuilt the web site. I'll try to recreate the exception locally and debug it.

Thanks.

_________________
~Dave Foderick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 1:04 pm 
Newbie

Joined: Thu Sep 01, 2005 3:55 pm
Posts: 11
The queries that use regular HQL run fine. Only the ones where I build up the criteria have a problem. The reason I did this is because I don't want to open up any vulnerability to SQL injection attacks.

_________________
~Dave Foderick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 3:28 pm 
Regular
Regular

Joined: Mon May 16, 2005 2:15 pm
Posts: 59
dfoderick wrote:
The queries that use regular HQL run fine. Only the ones where I build up the criteria have a problem. The reason I did this is because I don't want to open up any vulnerability to SQL injection attacks.


If you parameterize you HQL you shouldn't have this problem.

BOb


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 27, 2005 4:58 pm 
Newbie

Joined: Thu Sep 01, 2005 3:55 pm
Posts: 11
Thanks, Bob

I took your advice and rewrote it as a prameterized query and it seems to be working.

_________________
~Dave Foderick


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