-->
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: NHibernate Criteria Values with underscores
PostPosted: Wed Dec 05, 2012 2:03 pm 
Newbie

Joined: Tue Jul 20, 2010 2:06 pm
Posts: 2
Hi,

I have a NHibernate repository ARep with a method called "GetByItemNo(string itemNo)".

When I query the method with a value with no underscore, the method works perfectly and it returns the object I'm expecting. When I query the method with a value containing underscores, it returns NULL (and it's not true, the object I'm looking for has a corresponding row in the db).

Here's the content of my method :

public ObjectA GetByItemNo(string itemNo)
{
ObjectA result = null;
... some code ...
ICriteria criteria = session.CreateCriteria(typeof(ObjectA));
criteria.Add(Expression.Eq("ItemNo", itemNo));
criteria.SetMaxResults(1);
result = criteria.UniqueResult<ObjectA>();
... some code ...
return result;
}

It seems like NHibernate doesn't react correctly when I use the "Expression" Eq with a value containing underscores.

Why ? What is the solution to that ?

Thanks,
Claude


Top
 Profile  
 
 Post subject: Re: NHibernate Criteria Values with underscores
PostPosted: Mon Jan 21, 2013 8:10 am 
Newbie

Joined: Mon Jan 21, 2013 8:08 am
Posts: 1
oui j'ai déja fait ça le problème c'est que dans la partie show view de hibernate configurations après database il m'affiche pas mes tables de base de donnée je doute que le problème est due au fichier de configuration


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.