It was only example.
Have LazyLoad on component, I need to manualy get this field for each
object in collection, e.g
foreach(var item in coll)
{
if (item.Info==null){}
}but I think, if LazyLoad working on components in newest version, there must be sth to get the entity using criteria with all components which I want. I'm using auto mapper to map my entities to dto's, but this isn't in nhib session, so all fields which I need I must have filled. On 6 Paź, 00:05, Diego Mijelshon <[email protected]> wrote: > Components do not have fetchmodes. It doesn't make sense. > > Diego > > On Tue, Oct 5, 2010 at 16:25, lszk <[email protected]> wrote: > > 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]> > > <nhusers%[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]<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.
