openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Dellert (JIRA)" <>
Subject [jira] Created: (OPENJPA-911) Issue with FetchAttribute recursionDepth
Date Fri, 06 Feb 2009 23:10:59 GMT
Issue with FetchAttribute recursionDepth 

                 Key: OPENJPA-911
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 1.2.0
         Environment: JDK: Sun 1.6
Database: Derby
OS: Windows XP
            Reporter: Brian Dellert

I am attempting to leverage the recursionDepth FetchAttribute on a couple of related JPA entity
classes, but OpenJPA does not seem to be honoring the value in a certain scenario.  Even if
I specify a recursionDepth of 50, a load of the object graph is only returning a recursionDepth
of 1 in this scenario.

The issue I'm seeing manifests itself when there is a 'container' class which has a OneToOne
reference to an 'entity' class, and the 'entity' class has a OneToMany recursive self-reference
.  Here, when I first create an object graph where an instance of the 'container' class references
a 3 level entity graph, I can save the graph and then load the graph and the specified recursionDepth
is being honored.  If I then delete the 'container' object (which cascades the delete to the
'entity' graph), the delete occurs correctly.  But, if I then create/save a new graph of objects,
the subsequent load of this new graph does not honor the recursionDepth.  I have explicitly
added the relevant FetchGroups to the entity manager FetchPlan.

It should be noted that I needed to specify FetchGroups on both the OneToOne and OneToMany
references described above in order to get the initial load of the graph to succeed.  Also,
it should be noted that this seemed to work  correctly with OpenJPA 1.0.0.
The attached jar file contains a simple JUnit test case which illustrates this behavior. 
The test case can be run using maven by unjarring the attached file and running:

   mvn install 

in the openjpa_recursion_test/ directory.  There are comments in the test code which further
describe the issue.  If any additional information is needed, please let me know.  Thanks.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message