Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

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

Anupam M (JIRA)

2008-09-19

Replies: Find Java Web Hosting

Author LoginPost Reply
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

   
_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.