|
Home > Archive > Apache JDO Project > October 2005 > Questions concerning named queries
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Questions concerning named queries
|
|
| Michael Watzek 2005-10-20, 5:45 pm |
| Hi Craig,
I have 3 questions concerning named queries:
1) Assertion A14.5-13 specifies:
[...
The order is based on the metadata search order for class metadata, but
includes files named based on the query name.]
The assertion reads as if JDO defines a special metadata file having a
file name which equals the name of the named query. In the example
underneath that assertion the spec does not list such a file:
"...
If metadata is not found in the above, then the following files are
searched: META-INF/package.jdoquery, WEB-INF/package.jdoquery,
package.jdoquery, com/package.jdoquery, com/sun/
package.jdoquery, com/sun/nb/package.jdoquery, com/sun/nb/Bar.jdoquery."
Have implementations also lookup a metadata file like
<nameOfNamedQuery>.jdoquery?
2) The seach order for metadata specifies to lookup a file WEBINF/
package.jdo. In a web server the WEBINF directory cannot be looked up by
a classloader. Instead, it is available through the servlet context. I'm
not sure if (deployed) implementations are able to access the servlet
context of deployed applications.
Does it make sense to not specify named queries in a WEBINF directory of
the TCK?
3) The search order for metadata specifies that package jdo files are
evaluated before class jdo files.
Suppose there is a package jdo file containing metadata for class
Person. That jdo file would not define named queries on class Person.
Suppose further, there is a class jdo file for Person which does define
named queries. Are these named queries supposed to be found by
implementations?
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/
-------------------------------------------------------------------
| |
| Craig L Russell 2005-10-20, 5:45 pm |
| Hi Michael,
I talked to Michael Bouschen about these and we think that there is
some clarification needed in the specification.
On Oct 18, 2005, at 8:02 AM, Michael Watzek wrote:
> Hi Craig,
>
> I have 3 questions concerning named queries:
>
> 1) Assertion A14.5-13 specifies:
> [...
> The order is based on the metadata search order for class metadata,
> but includes files named based on the query name.]
>
> The assertion reads as if JDO defines a special metadata file
> having a file name which equals the name of the named query. In
> the example underneath that assertion the spec does not list such a
> file:
>
> "...
> If metadata is not found in the above, then the following files are
> searched: META-INF/package.jdoquery, WEB-INF/package.jdoquery,
> package.jdoquery, com/package.jdoquery, com/sun/
> package.jdoquery, com/sun/nb/package.jdoquery, com/sun/nb/
> Bar.jdoquery."
>
> Have implementations also lookup a metadata file like
> <nameOfNamedQuery>.jdoquery?
No, this needs to be clarified. No file with a query name is used.
>
> 2) The seach order for metadata specifies to lookup a file WEBINF/
> package.jdo. In a web server the WEBINF directory cannot be looked
> up by a classloader. Instead, it is available through the servlet
> context. I'm not sure if (deployed) implementations are able to
> access the servlet context of deployed applications.
>
> Does it make sense to not specify named queries in a WEBINF
> directory of the TCK?
Yes, we don't have a web server environment that we're testing
against, so we need not test this.
>
> 3) The search order for metadata specifies that package jdo files
> are evaluated before class jdo files.
>
> Suppose there is a package jdo file containing metadata for class
> Person. That jdo file would not define named queries on class
> Person. Suppose further, there is a class jdo file for Person which
> does define named queries. Are these named queries supposed to be
> found by implementations?
No, I don't think so. Once an implementation has found class
metadata, it should not look further, even for query declarations.
This needs clarification.
Craig
>
> 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/
> -------------------------------------------------------------------
>
|
|
|
|
|