As far as I know is the new LINQ provider integrated into NHibernate 3.0. So I can't use it with NH 2.1. However, I will checkout NH 3.0 asap and report a bug if the behavior is the same as in the old one.
Olaf On 28 Mai, 11:52, Stefan Wenig <[email protected]> wrote: > I'd look into the new 3.0 LINQ provider, guess nobody's going to fix > the old one. The new one seems to convert both boolean AND > (ExpressionType.AndAlso) and bitwise AND (ExpressionType.And) into HQL > BooleanAnd. I think that's a bug, if you can verify that just file an > issue. Should be a piece of cake; since HQL supports the exact same > syntax you'd want to write in LINQ (x & flag == flag), no further > conversion should be required. Not sure though, I don't quite get that > ANTLR stuff. > > On 27 Mai, 08:59, olaf <[email protected]> wrote: > > > > > Thanks, Unfortunately, HQL is not an option in my case. > > > Olaf > > > On 27 Mai, 02:05, Diego Mijelshon <[email protected]> wrote: > > > > If you're open to HQL instead of > > > Linq:http://stackoverflow.com/questions/2805661/how-to-query-flags-stored-... > > > > Diego > > > > On Tue, May 25, 2010 at 17:18, olaf <[email protected]> wrote: > > > > Hi, > > > > > I've defined an enum like this: > > > > > namespace Test > > > > { > > > > [System.FlagsAttribute] > > > > public enum ETest > > > > { > > > > Test1 = 1, > > > > Test2 = 2, > > > > Test3 = 4 > > > > } > > > > > public class ETestStringType : > > > > NHibernate.Type.EnumStringType<ETest> > > > > { > > > > } > > > > } > > > > > In my hbm file file I use it in a property: > > > > > <property name="TestEnum1" > > > > type="Test.ETestStringType, Test" > > > > not-null="true" /> > > > > > I can set the property with myObject.TestEnum1 = ETest.Test1 | > > > > ETest.Test2. > > > > > I use LINQ to quere the data: > > > > > var result = from obj in session.Linq<MyType> where obj.TestEnum1 == > > > > ETest.Test1 select obj; > > > > > This returns all objects with TestEnum1 set to "ETest.Test1" but not > > > > objects with TestEnum1 set to e.g. "ETest.Test1 | ETest.Test3" > > > > > I need a way to get all objects set to ETest.Test1 combined with any > > > > other flag. > > > > > Any ideas? > > > > > Thanks > > > > Olaf > > > > > -- > > > > 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.-ZitiertenText ausblenden - > > > > - Zitierten Text anzeigen -- Zitierten Text ausblenden - > > > - Zitierten Text anzeigen -- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - -- 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.
