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>