openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <>
Subject Does OpenJPA support updating of related objects via JPQL?
Date Mon, 18 Sep 2006 16:37:19 GMT
Does OpenJPA (or JPA, for tha matter) support the updating of related
objects via JPQL?  For example, should the following query work where we are
attempting to access the orderId on the related currentOrder object?

UPDATE Customer c SET c.currentOrder.orderId = :orderId WHERE =

As you can guess, we are getting an exception and call stack from OpenJPA.
But, then we started wondering whether this is even supported by the JPA
spec.  The spec isn't clear one way or the other (or, at least, I couldn't
find a definitive answer).  Any ideas?

In case you were wondering, here's the call stack:

[9/16/06 16:15:52:953 EDT] 00000032 ExceptionUtil E   CNTR0020E: EJB threw
an unexpected (non-declared) exception during invocation of method
"openOrder" on bean "BeanId(OpenJPATestEAR#OpenJPATest.jar#OrderEJB, null)".
Exception data: <4|false|0.9.0-incubating-SNAPSHOT>
org.apache.openjpa.persistence.ArgumentException: An error occurred while
parsing the query filter 'UPDATE Customer c SET c.currentOrder.orderId =
:orderId WHERE = :customerId'. Error message:
org.apache.openjpa.kernel.jpql.ParseException: Encountered "." at character
37, but expected: ["="].
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL
    at org.apache.openjpa.kernel.jpql.JPQLParser.parse(
    at org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(
    at org.apache.openjpa.kernel.QueryImpl.newCompilation(
    at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(
    at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(
    at org.apache.openjpa.kernel.QueryImpl.getOperation(
    at org.apache.openjpa.kernel.DelegatingQuery.getOperation(
    at org.apache.openjpa.persistence.QueryImpl.executeUpdate(


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message