I need to map a one-one relationship based off of a unique foreign key in
the parent table.  No matter what I do I tries to join on the parents
primary key.

Here's my current mapping:

<class name="ItemSearchDTO" table="icitem">
        <id name="Id" column="id_col">
            <generator class="identity"/>
        </id>
        <property name="ProductLineId" column="plinid"
length="6"></property>
      <one-to-one name="LineItem" class="ProductLineItem"
property-ref="ProductLineId"></one-to-one>

    </class>

the sql being generated is:
SELECT itemsearch0_.id_col   as id1_4_1_,
       itemsearch0_.itemstat as itemstat4_1_,
       itemsearch0_.item     as item4_1_,
       itemsearch0_.itmdesc  as itmdesc4_1_,
       itemsearch0_.plinid   as plinid4_1_,
       itemsearch0_.itmclss  as itmclss4_1_,
       itemsearch0_.type     as type4_1_,
       itemsearch0_.itmmemo  as itmmemo4_1_,
       itemsearch0_.Manufac  as Manufac4_1_,
       itemsearch0_.mpartno  as mpartno4_1_,
       itemsearch0_.suplier  as suplier4_1_,
       productlin1_.plinid   as plinid2_0_,
       productlin1_.plndesc  as plndesc2_0_
FROM   icitem itemsearch0_
       left outer join icPlin productlin1_
         on itemsearch0_.id_col = productlin1_.plinid
WHERE  itemsearch0_.id_col = 285 /* @p0 */

Thank you in advance,
John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to