-->
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: basic criteria question
PostPosted: Tue Feb 02, 2010 6:08 am 
Newbie

Joined: Mon Feb 01, 2010 7:51 pm
Posts: 4
hi,
i'm trying to use the criteria api to find all the records that their value is equal to some string.

in nhibernate v.1 we had the nhibernate.expression.eqExpression to do so.
i cant find equivalent in nhibernate v.2.1.2

i've tried to use the nhibernate.criterion / restrication api, but i cant find any method that has the desired behavior.
i could use like expression, but it seem odd for me that there is no equal expression in the api.

any ideas?

##edit##

found the answer (more or less...)
simpleExpression with op "=" do the work


##edit##


Top
 Profile  
 
 Post subject: Re: basic criteria question
PostPosted: Fri Feb 05, 2010 1:40 pm 
Newbie

Joined: Sat Dec 26, 2009 7:05 am
Posts: 8
ICriterion criterion = Expression.Eq(string propertyName, object value)
criteria.Add(criterion)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.