jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject [SPI] QueryInfo.getColumnNames()
Date Fri, 19 Jun 2009 15:19:10 GMT

while implementing JCR 2.0 query support for our SPI stack, I stumbled
across QueryInfo.getColumnNames(), which returns Name[]. It seems to
me this does not work any more with JCR 2.0 where the column names
must not necessarily be qualified names.

The specification for Column in AQM is:

type Column ::=
    Name selectorName,
    Name? propertyName,
    Name? columnName

that looks like columnName is a qualified name, but it's a bit
misleading. the actual columns are named according to the following

If propertyName is specified, columnName is required and used to name
the column in the tabular results. If propertyName is not specified,
columnName must not be specified, and the included columns will be
named ‚ÄúselectorName.propertyName‚ÄĚ.

that is, we may end up with a column name: selector.jcr:primaryType

if this is parsed as a name, it will most certainly fail because
selector.jcr is an unknown prefix :-/

I think what we have to do is either:

- change the return type of QueryInfo.getColumnNames() to String[]
- add a new method QueryInfo.getColumnNamesWhatever() that returns String[]

I guess either way the change will break existing implementations, so
we'd better go with the first option.

one detail however still bothers me. the column names are namespace
fragile. so, they aren't plain strings. that means if we just pass the
column name as string through the SPI a client will get parts of the
column name as a qualified name with a prefix mapping from the SPI
implementation. suppose a jcr2spi session locally remapped a namespace
then executes a query which includes a property with that namespace,
then the column name might not reflect the local remapping.

this could be fixed similar to how remappings are treated within the
query statement. an implementation of RepositoryService.executeQuery()
must use the passed namespaces map when column names are



View raw message