title: How to make query using google app engine endpoint for android?
body: <p>I'm developing an Android project using google app engine endpoints. We tried to insert a new query in an automatically generated endpoint class (I have a Poll.java class and a PollEndpoint.java class) in the server side, but the system doesn't work because a red cross is showed on the AppEngine part of the project. No other error message are shown.</p>
  
  <p>Code insert in PollEndpoint.java class:</p>
  
  <pre><code>@ApiMethod(name = "getLastPoll")
  public Long getLastPoll(@Named("date") Date date, @Named("creator") String creator) {
  EntityManager mgr = getEntityManager();
  Key id = null;
  
  try {
          Query query = mgr.createQuery("select keyPoll from Poll where creator
       =" + creator + " and creationDate = " + date);
          id = (Key)query.getSingleResult();
      } finally {
          mgr.close();
      }
      return id.getId();
  }
  </code></pre>
  
  <p>Is it correct to do query in this way?</p>