db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@datanucleus.org>
Subject Re: Methods in the result of an JDOQL query
Date Sat, 25 Oct 2008 11:11:53 GMT
> the current spec is not explicit on using methods in the query result
> expression, e.g.
>   "select this.phoneNumbers.size() from Employee",
>    "select this.phoneNumbers.get("home") from Employee",
>    "select this.firstName.substring(1,4) from Employee"
> It looks like a good idea supporting these kind of queries, but the
> question is whether there are any issues from the JDO implemention point
> of view. The related JIRA isse is
> https://issues.apache.org/jira/browse/JDO-580
> Comments?

Hi Michael,

supporting methods in the SELECT clause is of course fine in principal, and at 
the very least the spec needs to be explicit. In practice some methods would 
be harder to support than others. Thinking in an RDBMS context, things like 
String/Date methods usually have a related SQL function hence no issue. 
Collection.size() could equate to (SELECT COUNT(*) FROM ...) and some RDBMS 
(or some versions of some RDBMS) maybe won't be supporting that (subqueries).
Similarly Collection.contains(...) when the argument to contains is something 
other than a non-PC object, etc.

There may be other implementation issues to be found by whoever offers their 
time to implement them, 

Andy  (DataNucleus - http://www.datanucleus.org)

View raw message