openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Kronegg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-566) OpenJPA not supporting count(*) syntax
Date Tue, 07 Apr 2009 08:50:12 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696436#action_12696436
] 

Julien Kronegg commented on OPENJPA-566:
----------------------------------------

This issue also occurs under Seam. See https://jira.jboss.org/jira/browse/JBSEAM-3032

> OpenJPA not supporting count(*) syntax
> --------------------------------------
>
>                 Key: OPENJPA-566
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-566
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 1.0.2
>         Environment: Spring 2.5.3, JDK 1.5.
>            Reporter: Mathias Bogaert
>            Assignee: Pinaki Poddar
>            Priority: Blocker
>
> When executing a simple query using the (assumingly) valid count(*) syntax, accepted
by Hibernate, OpenJPA throws an exception.
> Caused by: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
An error occurred while parsing the query filter 'SELECT count(*) FROM Order instance'. Error
message: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException:
Encountered "*" at character 14, but expected: ["(", "+", "-", ":", "?", "ABS", "AVG", "COUNT",
"DISTINCT", "LENGTH", "LOCATE", "MAX", "MIN", "MOD", "SELECT", "SIZE", "SQRT", "SUM", <DECIMAL_LITERAL>,
<IDENTIFIER>, <INTEGER_LITERAL>].
> 	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
> 	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1645)
> 	at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:47)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:144)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery.newCompilation(QueryCacheStoreQuery.java:236)
> 	at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:633)
> 	at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:599)
> 	at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:661)
> 	at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487)
> 	at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
> 	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227)
> 	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
> 	at com.toyota.tme.jpapoc.dao.GenericDaoJpa$7.doInJpa(GenericDaoJpa.java:416)
> 	at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message