Java Mailing List Archive

http://www.gg3721.com/

Home » the NHibernate development list »

Re: [NHibernate-development] Mapping rewrite

Ayende Rahien

2008-06-29

Replies: Find Java Web Hosting

Author LoginPost Reply
I am _not_ interested in changing the XML. I am interested in selecting, at runtime, what is the class of the many-to-many association.
There is a difference between them

On Sun, Jun 29, 2008 at 4:17 PM, Fabio Maulo <fabiomaulo@gmail.com> wrote:
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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nhibernate-development


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
©2008 gg3721.com - Jax Systems, LLC, U.S.A.