The following query:
Query jquery = em.createQuery("SELECT o FROM Player o WHERE o.name
= \"Zarolho\" AND o.age = 33");
returns 1 result for me.
But doing this:
Query jquery = em.createQuery("SELECT o FROM Player o WHERE o.name = ?1
AND o.age = ?2");
jquery.setParameter(2, 33);
jquery.setParameter(1, "Zarolho");
returns nothing. And more strangely:
Query jquery = em.createQuery("SELECT o FROM Player o WHERE o.age = ?2
AND o.name = ?1");
jquery.setParameter(2, 33);
jquery.setParameter(1, "Zarolho");
returns the instance!
I just switch the positions for the fields and it works! Same string,
same code, only the position has changed. Please help, I'm stucked on
this for a long time.
--
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.