Issue Details (XML | Word | Printable)

Key: OPENJPA-461
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Ajay Aggarwal
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

JPQL: navigation through embedded class field does not work

Created: 06/Dec/07 02:47 PM   Updated: 11/Dec/07 01:25 AM
Return to search
Component/s: query
Affects Version/s: 0.9.7
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

Environment: BEA WebLogic Server 10
Issue Links:
Duplicate
 

Resolution Date: 11/Dec/07 01:24 AM


 Description  « Hide
Hi Ajay Aggarwal,

I think your query is correct and should work. According to the Java Persistence query language BNF the expression following the keyword SET might be a state_field and state_field includes navigation through an
embedded:
state_field ::= {embedded_class_state_field.}*simple_state_field

I propose you file a JIRA issue.

Regards Michael

> I am trying to update a field of the embedded class using query, but
> its not working. In the following code, 'registration' is an embedded
> class field inside 'User' and 'authenticated' is a boolean field
> inside this embedded class.
>
>
>
> Query q = em.createQuery("UPDATE User s SET
> s.registration.authenticated = :auth");
>
> q.setParameter("auth", false);
>
>
>
> I am getting following error. What is the correct syntax for such a
> query?
>
>
>
> openjpa.persistence.ArgumentException: An error occurred while parsing
> the query filter 'UPDATE User s SET s.registration.authenticated =
> :auth'. Error message: <4|false|0.9.7>
> org.apache.openjpa.kernel.jpql.ParseException: Encountered "." at
> character 33, but expected: ["="].
>
>
>
> Thanks.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Patrick Linskey added a comment - 11/Dec/07 01:24 AM
It sounds like this might be a duplicate of OPENJPA-199.