You might try the following.
Query query = manager.createQuery("select u from User u where u.name =
'[email protected]'");
// note use of identification variable & single quotes
User u = (User) query.getSingleResult();
Or, use a query parameter to avoid having to deal with quoting and/or
string concatenation (which subjects you to injection attacks), like
the following.
Query query = manager.createQuery("select u from User u where u.name
= :name");
query.setParameter("name", "[email protected]");
query.getSingleResult("[email protected]");
User u = (User) query.getSingleResult();
HTH,
Matthew
On Oct 31, 7:56 pm, Vova <[email protected]> wrote:
> Hello! Freand, help me please...
> src
>
> EntityManager manager = EMF.get().createEntityManager();
>
> Query query = manager.createQuery("Select from User where name = "
> +"[email protected]");
>
> User user = (User) query.getSingleResult();
>
> Portion of expression could not be parsed: @some.com!!! Why??
> How I get user by email??
--
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.