-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problems with HQL and IQuery.UniqueResult
PostPosted: Mon Mar 20, 2006 4:01 pm 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Hi.

I have the following HQL:

Code:
"SELECT COUNT(*) FROM NHibernateProvidersMapping.NHRole r WHERE r.AppId = 1 AND r.Name = \"Nota Fiscal - Cancelar\""


When I call IQuery.UniqueResult with the HQL above, the SQL generated is:

Code:
select COUNT(*) as x0_0_ from nhrole nhrole0_ where (nhrole0_.appid=1)AND(nhrole0_.name="Nota Fiscal-Cancelar")


Take a look at the param "name". The HQL string has the value "Nota Fiscal - Cancelar" (with a space before and after the -). But the SQL generated doesn't have these spaces.

Anybody knows what is wrong? Is it normal? Can I disable it?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 20, 2006 4:04 pm 
Newbie

Joined: Sun Sep 25, 2005 9:11 am
Posts: 13
Location: Bergen, Norway
Try this:

Code:
"SELECT COUNT(*) FROM NHibernateProvidersMapping.NHRole r WHERE r.AppId = 1 AND r.Name = 'Nota Fiscal - Cancelar'"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 20, 2006 4:12 pm 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Hum, thanks! :)

Do you know why can't I use the ""?


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