-->
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: Problem with HQL: Not all named parameters have been set
PostPosted: Sat Nov 11, 2006 5:55 am 
Newbie

Joined: Fri Oct 20, 2006 10:33 am
Posts: 1
Code:
User usr = new User();

usr.UserName = "a%";
usr.Membership = new Membership();
usr.Membership.Email = "a%";

IQuery testQuery = Db.Session.CreateQuery("from usr in class User here usr.UserName like :UserName and usr.Membership.Email like :Membership.Email");

testQuery.SetProperties(usr);


Error: Not all named parameters have been set: [Membership.Email] [from usr in class User where usr.UserName like :UserName and usr.Membership.Email like :Membership.Email]

Why?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 9:21 am 
Newbie

Joined: Wed Sep 06, 2006 8:33 am
Posts: 19
Try this:

Code:
(...)

IQuery testQuery = Db.Session.CreateQuery("from usr in class User where usr.UserName like :UserName and usr.Membership.Email like :Email").SetParameter("UserName", usr.UserName).SetParameter("Email", usr.Membership.Email);

IList results = testQuery.List();
(...)


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.