so and so.. looking at the VisualStudio intellisense, can you tell me which is the name of that string parameter ?
On Fri, Jul 8, 2011 at 7:45 PM, Ricardo Peres <[email protected]> wrote: > Hi, Fabio! > > Are query-only properties already supported by the new mapping? I have > this mapping: > > mapper.Class<Customer>(ca => > { > ca.Table("`CUSTOMER`"); > ca.Id(x => x.Id, map => > { > map.Column("`ID`"); > map.Generator(new HiLoWithSuffixIdGenerator(), g => > g.Params(new > { max_lo = "1000" })); > }); > ca.Set<Order>("LastWeekOrders", x => > { > x.Fetch(CollectionFetchMode.Subselect); > x.Where("(Date >= (GETDATE() - 7))"); > x.Access(Accessor.None); > x.Inverse(true); > x.Mutable(false); > x.Key(y => y.Column("`CUSTOMERID`")); > }); > ... > } > > This fails with a MappingException: Member not found. The member > 'RecentOrders' does not exists in type Domain.Customer". > As you can guess, LastWeekOrders does not exist, this is why I mapped > it as a string, not with a strongly typed expression. I think that > when Accessor.None is specified NHibernate should not try to find the > property, isn't it correct? > > Thanks! > > RP -- Fabio Maulo
