How to filter entities by their parents in ManyToOne side in Google App Engine

Posted by palto on Stack Overflow See other posts from Stack Overflow or by palto
Published on 2010-06-13T13:39:49Z Indexed on 2010/06/13 13:42 UTC
Read the original article Hit count: 208

Filed under:
|

I use Google App Engine. When I try to do a JPA query like this: "SELECT p FROM Participant p WHERE p.party.id = :partyKey AND p.name=:participantName" I get the following error

Caused by: org.datanucleus.store.appengine.FatalNucleusUserException: SELECT FROM Participant p WHERE p.party.id = :partyKey AND p.name=:participantName: Can only reference properties of a sub-object if the sub-object is embedded.

I gave the key of the Party object as a parameter to the "partyKey" named parameter.

The model is like this: Party has multiple Participants.

I want to query a participant based on the party and the name of the participant. I just can't figure out how to filter using the party. What options do I have?

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about jpa