openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Prud'hommeaux (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-75) error message for missing query id var needs improvement
Date Mon, 06 Nov 2006 19:34:41 GMT
    [ http://issues.apache.org/jira/browse/OPENJPA-75?page=comments#action_12447510 ] 
            
Marc Prud'hommeaux commented on OPENJPA-75:
-------------------------------------------

That sounds like a very good idea. We already do something along those lines for unrecognized
configuration property names (see ConfigurationImpl.warnInvalidProperty and StringDistance.getClosestLevenshteinDistance),
so that sort of thing could be used also for unrecognized variable/field names in queries.

> error message for missing query id var needs improvement
> --------------------------------------------------------
>
>                 Key: OPENJPA-75
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-75
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: David Wisneski
>
> the query is 
> select sum(loginCount), sum(logoutCount) from AccountEntity as a where a.accountProfile.userID
like 'uid:%' 
> loginCount and logoutCount are declared in a MappedSuperClass.
> the correct query is 
> select sum(a.loginCount), sum(a.logoutCount) from AccountEntity as a where a.accountProfile.userID
like 'uid:%' 
> Rather than a syntax error, a ArgumentException was thrown.  (see below)
> Also the user would like to see a better error message in the case of a field name using
wrong upper/lower case.
> In other words, if the query was 
>     where  a.userid = ...
> and what he intended was 
>    where a.userId = ...
> then the message should say  " userid undefined.  DId you mean userId? "
> Also if a state field is inherited but declared private and hence not visible, then error
message should read 
>   "a.userId invalid because it is not visible" rather than "a.userId not defined".
>   <4|false|0.9.0-incubating-SNAPSHOT> org.apache.openjpa.persistence.ArgumentException:
null
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O <4|false|0.9.0-incubating-SNAPSHOT>
org.apache.openjpa.persistence.ArgumentException: null
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:755)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:716)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:712)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:512)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:216)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:271)
> [11/3/06 12:47:04:734 CST] 0000003c SystemOut     O 	at org.apache.geronimo.samples.daytrader.ejb3.TradeJPA.resetTrade(TradeJPA.java:1864)
> while running a JPA query.  The code for it looks like the following:
> 	q = em.createQuery("select sum(loginCount), sum(logoutCount) from AccountEntity as a
where a.accountProfile.userID like 'uid:%'");
> 	Object[] rs = (Object[]) q.getSingleResult();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message