-->
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: URGENT: Uni directional many-to-one does select
PostPosted: Thu Jul 01, 2010 3:17 pm 
Newbie

Joined: Tue Jun 29, 2010 1:35 pm
Posts: 3
Hi,

I Have an issue where my many-to-one association fires an extra select for every row on Many side of the association when it is unable to find a match on the one side of the assocation.

For example in the data set i have a table with cardno which has an many to one association to the attendant card number. But when it encounters value 456 which does not have an attnedant, it performs an select statement.

Iam using hibernate 3.0.5 and jdk 1.4. Can you please help me out with what iam i doing wrong.

The Data Set :
Code:

  CARDNO
-----------
123
321
456
123
321

ATTNDNO       ATTNDNAME
----------     -------------
123                 XYZ
321                 ZYX



Mapping:-
Code:
<many-to-one name="attendant"
         class="com.domain.businessobjects.Attendant" lazy="false"
         outer-join="true" update="false" cascade="none" not-null="false"
         insert="false" not-found="ignore" fetch="join" optimistic-lock="false">
         <column name="CARDNO" />
      </many-to-one>

<class name="com.domain.businessobjects.Attendant"
      table="ATTENDANTS" lazy="false" where=" TIMEIN !=0 and DATEIN !=0 "
      optimistic-lock="none">
      <id name="cardNo" column="CARDNO"
         type="com.domain.persistence.types.StringAsFixedCharType">
         <generator class="assigned" />
      </id>
      <property name="attendantName" column="ATTENDANTNAME"
         not-null="true"
         type="com.domain.persistence.types.StringAsFixedCharType" />
   </class>



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.