[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3487) DefaultLoadEventListener does not honor lazy load (LoadEventListener.LoadType.INTERNAL_LOAD_LAZY)

Will Hoover (JIRA) noreply at atlassian.com
Fri Sep 19 13:20:04 EDT 2008


DefaultLoadEventListener does not honor lazy load (LoadEventListener.LoadType.INTERNAL_LOAD_LAZY)
-------------------------------------------------------------------------------------------------

                 Key: HHH-3487
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3487
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
         Environment: N/A
            Reporter: Will Hoover
            Priority: Critical


DefaultLoadEventListener#doLoad(...) and  DefaultLoadEventListener#loadFromDatasource(...) does not honor LoadEventListener.LoadType.INTERNAL_LOAD_LAZY

USE CASE:

1) Create Actor table with self-referencing parent/child relationship with the following mapping- results in SessionImpl#internalLoad(...) setting LoadEventListener.LoadType to LoadEventListener.LoadType.INTERNAL_LOAD_LAZY:

<hibernate-mapping>
   <class name="Actor" table="ACTOR">
      <id name="id" type="java.lang.Long">
         <column name="ID" precision="22" scale="0" />
         <generator class="assigned" />
      </id>
      <many-to-one name="actor" class="Actor" lazy="no-proxy">
         <column name="PARENT_ID" precision="22" scale="0" not-null="true" />
      </many-to-one>
      <set name="actors" inverse="true" >
         <key>
            <column name="PARENT_ID" precision="22" scale="0" not-null="true" />
         </key>
         <one-to-many class="Actor" />
      </set>
   </class>
</hibernate-mapping>

2) Add a parent/child relationship entries in database: ID:1,PARENT_ID:1 and ID:2,PARENT_ID:1

3) Issue "Actor actor = (Actor) session.get(Actor.class, 1L);"

Results: Hibernate.isPropertyInitialized(actor, "actor") == true

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