> Tilmann reports that subqueries that return collections don’t seem to work. > The only subqueries that are tested in the tck return aggregates (AVG, MAX, > MIN, etc). > So should we change the specification to require that subqueries must return > single values?
No, Tilmann actually reported that DataNucleus does not support INVOKING METHODS on the result of a subquery. Which is not the same as saying a subquery that returns non-aggregates "doesn't work". The JDO spec, when talking about methods, says "The following methods are supported for their specific types, with semantics as defined by the Java language:" That "specific type" is interpreted as the type of a FIELD/PROPERTY in DataNucleus. In terms of specifics:- In the first of Tilmanns examples he did "(...).isEmpty()", which you could get the equivalent of with "== null" I'd guess (without trying it). In the second of Tilmanns examples he did "(...).get(num)" which you would have a lot of trouble translating to SQL, besides the fact that a Collection does not have a "get" method FWIW, only a List. Anyway, if someone wants to implement support for invoking methods on SubqueryExpression they can get the code from the usual place. I've never seen a reasonable use-case for it (other than people saying I wonder what happens if I do this). Regards -- Andy DataNucleus (Web: http://www.datanucleus.org Twitter: @datanucleus)