NHibernate version: 1.2.0
Hi ,
first of all, excuse me for my poor english.
I have 2 mapping classes ( A and B ) and B had a many-to-one 's definition on A but not on the Primary key of A.
So, i have something like that :
B Class
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="..." assembly="...">
<class name="B" table="TableB">
<composite-id ...>
...
</composite-id>
...
...
<many-to-one name="FooA" fetch="join" class="A" update="false" insert="false" property-ref="NumeroComptable" column="columnA"/>
</class>
</hibernate-mapping>
It's work but it's to long because it's made one select method by A object to load.
SQL Log of NHibernatein first, it's correctly load the code B object.
Code:
2007-05-18 09:45:41,882 DEBUG NHibernate.SQL LogCommand [(null)] - select B.ColumnsB as ColumnsB 19_, ...
but, after this one line, i've a SELECT line for each A object matching with Resquest B's result.
So if i've 1800 result on the B request... NHibernate made 1800 "Select ..." method to load appropriate A object.
Anyone have an idea?