Please clarify? In order to do simple "not equals" comparisons I'll have to resort to using CreateSQLQuery??
On Aug 25, 1:02 pm, Tuna Toksoz <[email protected]> wrote: > Write your own? > > Tuna Toksöz > Eternal sunshine of the open source mind. > > http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike > > > > On Wed, Aug 25, 2010 at 1:56 PM, MattO <[email protected]> wrote: > > This one is throwing me for a bit of a loop and still don't know how > > to write a "not equals" query. > > > In Hibernate for java there appears to be an Expression.ne (not > > equals) that you can use. This doesn't exist in nHibernate 2.1.2. > > > So I tried this: > > > criteria.Add(!Expression.Eq("ChildFormID",1)); > > > and also this: > > > criteria.Add(Expression.Not(Expression.Eq("ChildFormID",1))); > > > But neither of those have the desired effect of writing out my WHERE > > SQL clause as follows: > > > WHERE ChildFormID <> 1 > > > Instead what I get with the above two examples (but it is incorrect > > for what I'm trying to accomplish) is > > > WHERE NOT (ChildFormID = 1) > > > So how do you do a "Not Equals" using Criterion API?? > > > -- > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
