-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem in Many-to-one, too many select method are made
PostPosted: Fri May 18, 2007 5:38 am 
Newbie

Joined: Fri May 18, 2007 5:25 am
Posts: 1
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 NHibernate
in 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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.