Note that there are some explanatory texts on larger screens.

plurals
  1. PO@Nullable @Named in GAE / Android Sample
    text
    copied!<p>I'm trying to work on the sample GAE / Android app. There is Place Entity.</p> <p>In generated PlaceEndpoint class there is a method:</p> <pre><code>@ApiMethod(name = "listGame") public CollectionResponse&lt;Place&gt; listPlace( @Nullable @Named("cursor") String cursorString, @Nullable @Named("limit") Integer limit) { EntityManager mgr = null; Cursor cursor = null; List&lt;Game&gt; execute = null; try { mgr = getEntityManager(); Query query = mgr.createQuery("select from Place as Place"); if (cursorString != null &amp;&amp; cursorString != "") { cursor = Cursor.fromWebSafeString(cursorString); query.setHint(JPACursorHelper.CURSOR_HINT, cursor); } if (limit != null) { query.setFirstResult(0); query.setMaxResults(limit); } execute = (List&lt;Game&gt;) query.getResultList(); cursor = JPACursorHelper.getCursor(execute); if (cursor != null) cursorString = cursor.toWebSafeString(); // Tight loop for fetching all entities from datastore and accomodate // for lazy fetch. for (Game obj : execute) ; } finally { mgr.close(); } return CollectionResponse.&lt;Game&gt; builder().setItems(execute) .setNextPageToken(cursorString).build(); } </code></pre> <p>As I understand <code>cursor</code> and <code>limit</code> all optional params.</p> <p>However I can't figure out how to pass them using <code>Placeednpoint</code> class on the client side:</p> <pre><code>Placeendpoint.Builder builder = new Placeendpoint.Builder(AndroidHttp.newCompatibleTransport(), new JacksonFactory(), null); builder = CloudEndpointUtils.updateBuilder(builder); Placeendpoint endpoint = builder.build(); try { CollectionResponsePlace placesResponse = endpoint.listPlace().execute(); } catch (Exception e) { e.printStackTrace(); </code></pre> <p>Normally, when params are not nullable I would pass them in endpoint.listPlace() method. But when params are nullable, client side app doesn't see alternative constructor, that would accept params.</p> <p>How am I supposed to pass them then?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload