pvginkel/NHibernate.OData — pull request #12 by dsigitov (2014-11-13 11:53:52+00:00)
Title: Add support for NHibernate components

This pull request adds support for [NHibernate components](http://nhforge.org/doc/nh/en/index.html#mapping-declaration-component).

In order to implement this, I pass a list of all persistent classes (extracted from `ISessionFactory`'s class metadata) down to `AliasingNormalizeVisitor`. Then, when members are visited, I check whether the member's type is a persistent class. If it is a persistent class and it isn't the last member, then an alias is constructed, otherwise the member path is left intact.

For example, consider the `Child/Component/Value` member expression.
The `Child` is a persistent class, so we create an alias for it: `t1 => Child`, and replace the result path with this alias: `t1`.
The `Component` is not a persistent class, so we just concat the result path with it: `t1.Component`.
The `Value` is not a persistent class, we concat the result path with it: `t1.Component.Value`.

The resolved member expression is `t1.Component.Value` and the only created alias is `t1 => Child`.

I don't think this is a breaking change because component expressions weren't working, so I didn't add new configuration options.