I noticed when using any kind of a projection on a mapping that contains 
either a component or a reference the component/reference gets cut off in 
the query.

If there's any restrictions on the component/reference then the query fails.

Example:
        public ItemMap()
        {
            Table("Item");
            Id(x => x.KeyColumn);

            Map(x => x.SomeData1);
            Map(x => x.SomeData2);

            References(x => x.SomeReference, " KeyColumn ")
                .Fetch.Join();
        }

session.CreateCriteria<Item>()
    .Add(Restrictions.Eq("SomeReference.Column2", "value"))
    .SetProjection(Projections.Constant("1"))
    .List();

Obviously this isn't something real, but it doesn't matter which projection 
is used, Projections.RowCount() or anything. This will fail because the 
join gets removed. Is there anything I can do to get around this?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/oJoe_FNMZ5IJ.
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.

Reply via email to