I have one more question.
How can I using the criteria from my first post take the Info object
to the result too?
I see, SetFetchMode("Info", FetchMode.Select) works only for other
entties, but not for components.On 4 Paź, 01:07, Diego Mijelshon <[email protected]> wrote: > Did you try Expression.Eq("info.Published", true), _without_ the additional > CreateCriteria? > > Diego > > On Sun, Oct 3, 2010 at 20:01, lszk <[email protected]> wrote: > > Hi. > > > I have an Article entity with one component. > > > public ArticleMap() > > { > > //... > > > Component(x => x.Info, y => > > { > > y.Map(x => x.IsNews).Not.Nullable(); > > y.Map(x => x.Published).Not.Nullable(); > > y.Map(x => x.Saved).Not.Nullable(); > > }).LazyLoad(); > > } > > > It nice works with lazy load, but in one query I need to check one > > field from this component > > > ICriteria criteria = Session.CreateCriteria<Article>() > > .SetFirstResult(min) > > .SetMaxResults(max) > > .CreateCriteria("Info") > > .Add(Expression.Eq("Published", true)); > > > This query doesn't work. I have exception, that Published field is not > > definied in Article. > > How can I query entity by field contained in component? > > > -- > > 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. -- 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.
