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 Question about named queries
Date Tue, 18 Oct 2005 17:56:41 GMT
Hi,

I have a question about the algorithm to search the metadata for a named 
query as defined in section 14.5 "Query Factory in PersistenceManager 
interface" (see description of method newNamedQuery).

(1) The spec says that if the named query is not found in already-loaded 
metadata, it examines metadata files until the query is found. I read 
this that JDO looks into .jdo files even in case the class metadata was 
loaded from a different .jdo file earlier in the search order. Suppose 
you have a package.jdo including metadata of class Bar and this does not 
define any named query. Then there is a class .jdo file Bar.jdo defining 
a named query. Chapter 18 defines that the metadata from the package.jdo 
file will be used instead of the one from the class .jdo file.

However, the algorithm for searching named queries reads as if it should 
find the named query in the class jdo file. I think this is confusing, 
especially because the named query might be written with respect to the 
metadata of the class .jdo file and this might conflict with the metdata 
that is loaded from the other file. I propose that once the metadata for 
a class is loaded no other .jdo file should be examined for searching 
named queries.

(2) The spec says the search order for named queries includes files 
named based the query name. But the example as given in the spec is 
based on the class name: it includes the file Bar.jdoquery and Bar is 
the class name, not the query name. I think using the class name makes 
more sense and propose to keep the example, but change the description.

What do you think?

Regards Michael
-- 
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			


Mime
View raw message