[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-5882) JPA lazy Load problem on many-to-one property getter
Gail Badner (JIRA)
noreply at atlassian.com
Thu Oct 27 05:57:26 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gail Badner updated HHH-5882:
-----------------------------
Fix Version/s: (was: 4.0.0.CR5)
4.0.0.next
> JPA lazy Load problem on many-to-one property getter
> ----------------------------------------------------
>
> Key: HHH-5882
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5882
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.6.0
> Environment: Windows 7, JDK 1.6 ,MySQL 5.5
> Reporter: Leo Deng
> Assignee: Steve Ebersole
> Fix For: 4.0.0.next
>
> Attachments: TestJPA.zip
>
>
> Hibernate could not work properly when I use lazy load in many-to-one situation.you can run the test case in attachment.
> I try to get primary-key property of parent object which get from child object property.Hibernate query the parent object from database by foreign key successfully. But when I try to use org.hibernate.property.Getter Interface to read some property, hibernate return null to me.
> My code in attachment can be described as follow:
> <1>Test function "TestEagerLoadManyToOne" using Eager load can pass the test. Code logic are:
> 1)Load Child object from database
> 2)Get "parentObj" property and test whether "parent_id" field in parent is NULL;
> 2)Use org.hibernate.property.Getter to get "parent_id" field and test the result.
> <2>Test function "TestLazyLoadManyToOne" do exactly same thing just like "TestEagerLoadManyToOne", but the "Child" class change "parentObj" property to lazy load mode. this test function could not pass.
> Please fix this issue. It's crucial to my project.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list