[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-3891) one-to-one with property-ref always non-lazy

Diego Plentz (JIRA) noreply at atlassian.com
Tue May 5 14:07:17 EDT 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Plentz resolved HHH-3891.
-------------------------------

    Resolution: Rejected
      Assignee: Diego Plentz

https://forum.hibernate.org/viewtopic.php?t=975957
https://forum.hibernate.org/viewtopic.php?t=969713

> one-to-one with property-ref always non-lazy
> --------------------------------------------
>
>                 Key: HHH-3891
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3891
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>            Reporter: Sandeep Vaid
>            Assignee: Diego Plentz
>
> I have one-to-one relationship betnwee Product and ProductBasic.
>   <one-to-one name="productBasic" cascade="save-update" property-ref="activeProduct" lazy="proxy">
>     <formula>'1'</formula>
>     <formula>PRODUCTID</formula>
>  </one-to-one>
>  
>  
>  ProductBasic.hbm.xml as :
>  <properties name="activeProduct">
>    <property  name="Code" column="CODE"></property>
>    <property  name="pId" column="PID" insert="false" update="false"></property>
>   </properties>
>   
>   
>   When i am using property-ref, and try to load Product, it eagerly fetches ProductBasic also as :
>   
>   select *
>   from PRODUCT productbo0_ left outer join PRODUCTPERIOD productbas1_ on '18'=productbas1_.CODE and productbo0_.PID=productbas1_.PID where productbo0_.PID=?
>   
>  NOTE: Along with Product, ProductBasic is also fetched in a single query.
>  
>  Even if i add constrained="true" in one-to-one mapping, the query gets fired as :
>   select * from PRODUCT productbo0_ where productbo0_.PID=?
>   select * from PRODUCTBASIC productbas0_ where productbas0_.CODE=? and productbas0_.PID=?
>   
>   NOTE: Along with Product, ProductBasic is also fetched in a different query.
>   
>   BUT in both these cases, ProductBasic is fetched always (non-lazy)..
>   
>   How can i fetch ProductBasic in a Non-Lazy manner in this case.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list