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.- 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.
