db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Schulze <nlma...@users.sourceforge.net>
Subject Re: Clarifications on fetch depth
Date Thu, 15 Dec 2005 22:49:54 GMT
Alexander Bieber wrote:

> In my oppinion it would be better to change the spec back to its 
> previous version, so that fetch-depth applies only to self-referencing 
> (=recursive) fields (direct _and_ indirect). A hard limit could be set 
> on detachCopy with an additional parameter detachDepth that will apply 
> to the object graph of the top-level object that is detached.

Hello all!

I totally agree that the new behaviour not only makes life more 
complicated, but implies design problems as well, and that a change back 
to the old behaviour would be very helpful. But instead of a new 
parameter for the detachCopy method, I'd like to mention a possible 
alternative: a getter-setter-pair for the fetchplan:

    PersistenceManager.getFetchPlan().getMaxFetchDepth();
    PersistenceManager.getFetchPlan().setMaxFetchDepth(mfd);

This maximum fetch-depth should be relative to the root of the object 
graph, while the fetch-depth declared per field only applies to relative 
self-referencing - i.e. recursion (= old behaviour).

IMHO both, detachCopy derivate or fetchplan property, are adequate. But 
the new behaviour of fetch-groups is not logical, because the definition 
of a fetch-group happens per field/class while its effects depend on the 
use-case. IMHO, parameters that apply to the use-case should be defined 
runtime (i.e. parameter/getter-setter) while static definitions should 
be usecase-independent. I hope, you understand what I mean...

Any other opinions?

Best regards, Marco.

Mime
View raw message