[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4046) <many-to-one../> with property-ref fails to bring lazily

radhakrishna (JIRA) noreply at atlassian.com
Sat Jul 18 17:35:12 EDT 2009


<many-to-one../> with property-ref fails to bring lazily
--------------------------------------------------------

                 Key: HHH-4046
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4046
             Project: Hibernate Core
          Issue Type: Sub-task
          Components: core
    Affects Versions: 3.3.2
            Reporter: radhakrishna
            Priority: Critical


There are issues with using <one-to-one../> where it does not bring the entities lazily for its own reason.

But <many-to-one../> using property-ref is also getting eagerly loaded.

I tried both the mappings in the child mapping file,

<many-to-one name="parent" column="parent_ID"  property-ref="someDummyParentId"
		  		unique="true" class="ParentObj"  />

<many-to-one name="parent" column="parent_ID" unique="true"
			class="Parent" property-ref="someDummyParentID" lazy="proxy"
			cascade="none" insert="false" update="false">
		</many-to-one>

where I mentioned the  someDummyParentID to the SAME PK of the parent, and it eagerly fetches

in the parent mapping file
<property name="dummyEcDisplaySettingId" column="parent_ID"
			insert="false" update="false"></property>


If i mention the same <many-to-one as

<many-to-one name="parent" column="parent_ID" 
		  		unique="true" class="Parent"  />

where parent_ID is the FK in the child table and obviously it joins with the PK of the Parent table, it works fine and brings the parent lazily by default, it is lazy="proxy"


-- 
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