2008/6/29 Ayende Rahien <
ayende@ayende.com>:
I am playing with rewriting the mapping at the moment.
Specifically, I am trying to turn this:
<set name="Users"
access="property"
table="UsersToUsersGroups"
lazy="true">
<cache usage="read-write"
region="rhino-security"/>
<key column="GroupId" />
<many-to-many class="Rhino.Security.IUser"
column="UserId"/>
</set>
To an association to SomeUserClass which is only known at runtime.
There isn't any way to do that that I can see without doing XML manipulation.
many-to-any
I want to be able to do this programatically.
The issue is with the second pass compile creating and then validating information, without giving me any way to handle this. At that point, it gets the value directly from the XML file, without a hook to use to deal with this.
I am thinking about several ways of handling this, but so far haven't found something that I really like.
I am thinking about adding something like Configuration.AfterConfigurationProcessed at Configuration.SecondPassCompile(), just before we start second pass compile on the table mapping.
I think that I understand what you are doing and I prefer to study all situation around ORM<T> after we have port all mapping features from H3.2.5 (you know, I'm working on mapping.xsd).
When we have all other "things" working we can start the work to have :
<class name="Parent{T}">
<id name="Id">
<generator class="hilo" />
</id>
<set name="Users" table="UsersToUsersGroups">
<key column="GroupId" />
<many-to-many class="T" column="UserId"/>
</set>
</class>
but inside NH, not outside it.
--
Fabio Maulo