Hello,

I have two beans that are associated :

@Entity
public class User {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Key key;

    [...]
}

@Entity
public class Profil {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Key key;

    private Key user;

   [...]
}



I want to select a Profil by the user key :

User userBean = dao.getUser();
Query query = em.query("SELECT p FROM Profil p WHERE p.user = " +
userBean.getKey())



But my query throws an exception :

org.datanucleus.store.appengine.query.DatastoreQuery
$UnsupportedDatastoreFeatureException: Problem with query <SELECT FROM
Profil p WHERE p.owner = User(21)>: Unsupported method <User> while
parsing expression: InvokeExpression{[null].User(Literal{21})}



I tried with quotes :

Query query = em.query("SELECT p FROM Profil p WHERE p.user = ' " +
userBean.getKey() + " ' ")

But then, the query returns no result.

Thank you for your help :)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to