db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Bouschen" <mbo.t...@spree.de>
Subject Re: Assertion A14.6-21 (Query.getFetchPlan)
Date Thu, 20 Oct 2005 15:44:28 GMT
Hi Michael,

this is a good question and I'm not sure whether I have a good answer :-).

The post-load attribute defaults to true for the default-fetch-group. So
I'm wondering whether you are able to see any difference, if you remove
the default-fetch-group and add a new fetch group having the same value
for post-load. Would it help if the new fetch group loads some
relationship fields? Then, if this new group is active some more instances
get loaded compared to what happens with an active default-fetch-group.
This means the jdoPostLoad of the related instance is executed. Maybe this
jdoPostLoad could throw an exeception which we catch in the test case. But
maybe there is an easier way.

Regards Michael

> Hi,
> assertion A14.6-21 specifies:
> "This method retrieves the fetch plan associated with the Query. It
> always returns the identical instance for the same Query instance. Any
> change made to the fetch plan affects subsequent query execution."
> I wonder, how the second part of this assertion can be tested. Does the
> following idea make sense:
> A class PC defines a fetch group A with post-load true. Class PC defines
> a postLoad callback which sets a transient field for each persistent
> field.
> The test case creates a query instance having candidate class PC.
> Afterwards, it retrieves the fetch plan, removes the default fetch group
> and adds fetch group A. Then, it executes the query.
> Finally, the test case checks for each returned query instance, if the
> transient fields which correspond with persistent fields of fetch group
> A have the right values.
> Would this work, or would the persistent field access in postLoad
> retrieve values from the database for non-loaded fields?
> Regards,
> Michael
> --
> -------------------------------------------------------------------
> Michael Watzek                  Tech@Spree Engineering GmbH
> mailto:mwa.tech@spree.de        Buelowstr. 66
> Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
> Fax.:  ++49/30/217 520 12       http://www.spree.de/
> -------------------------------------------------------------------

Michael Bouschen          Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de  http://www.tech.spree.de/
Tel.:++49/30/235 520-33   Buelowstr. 66
Fax.:++49/30/2175 2012    D-10783 Berlin

View raw message