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

Reply via email to