title: Generate Client Libraries fails if ClassnameEndpoint.java has 'Multiple methods with same rest path "GET classname": etc
body: <p>after generating Endpoint from a model class I edit the ClassnameEndpoint file to make a method that will return a list of Entities using a modified SELECT string.  </p>
  
  <p>Somehow this makes a clash and Generate Client Libraries fails like this:</p>
  
  <p>INFO: Successfully processed C:\Users\1177\AndroidStudioProjects\N5\appN5-AppEngine\target/generated-sources/appengine-endpoints\WEB-INF/appengine-web.xml
  [ERROR] 
  com.google.api.server.spi.config.validation.ApiConfigInvalidException: Multiple methods with same rest path "GET eventdata": "listUserEventData" and "listEventData"</p>
  
  <p>here is the ClassnameEndpoint.java, which is edited by hand after being generated:</p>
  
  <p>note listEventData and listUserEventData are identical except for SELECT string...</p>
  
  <p>So how can I create an endpoint method to get ALL the entities and another method to get SOME entities without the clash?</p>
  
  <pre><code>package sic.example.appn5;
  
  import com.google.api.server.spi.config.Api;
  import com.google.api.server.spi.config.ApiMethod;
  import com.google.api.server.spi.config.ApiNamespace;
  import com.google.api.server.spi.response.CollectionResponse;
  import com.google.appengine.api.datastore.Cursor;
  import com.google.appengine.datanucleus.query.JPACursorHelper;
  
  import java.util.List;
  
  import javax.annotation.Nullable;
  import javax.inject.Named;
  import javax.persistence.EntityExistsException;
  import javax.persistence.EntityNotFoundException;
  import javax.persistence.EntityManager;
  import javax.persistence.Query;
  
  @Api(name = "eventdataendpoint", namespace = @ApiNamespace(ownerDomain = "example.sic", ownerName = "example.sic", packagePath = "appn5"))
  public class EventDataEndpoint {
  
      /**
       * This method lists all the entities inserted in datastore.
       * It uses HTTP GET method and paging support.
       *
       * @return A CollectionResponse class containing the list of all entities
       * persisted and a cursor to the next page.
       */
  
      @SuppressWarnings({"unchecked", "unused"})
      @ApiMethod(name = "listEventData")
      public CollectionResponse&lt;EventData&gt; listEventData(
              @Nullable @Named("cursor") String cursorString,
              @Nullable @Named("limit") Integer limit) {
  
          EntityManager mgr = null;
          List&lt;EventData&gt; execute = null;
  
          try {
              mgr = getEntityManager();
              Query query = mgr.createQuery("select from EventData as EventData");
              Cursor cursor;
              if (cursorString != null &amp;&amp; cursorString.trim().length() &gt; 0) {
                  cursor = Cursor.fromWebSafeString(cursorString);
                  query.setHint(JPACursorHelper.CURSOR_HINT, cursor);
              }
  
              if (limit != null) {
                  query.setFirstResult(0);
                  query.setMaxResults(limit);
              }
  
              execute = (List&lt;EventData&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 (EventData obj : execute) ;
          } finally {
              if (mgr != null) {
                  mgr.close();
              }
          }
  
          return CollectionResponse.&lt;EventData&gt;builder()
                  .setItems(execute)
                  .setNextPageToken(cursorString)
                  .build();
      }
  
      @SuppressWarnings({"unchecked", "unused"})
      @ApiMethod(name = "listUserEventData")
      public CollectionResponse&lt;EventData&gt; listUserEventData(
              @Nullable @Named("username") String username,
              @Nullable @Named("cursor") String cursorString,
              @Nullable @Named("limit") Integer limit) {
  
          EntityManager mgr = null;
          List&lt;EventData&gt; execute = null;
  
          try {
              mgr = getEntityManager();
              Query query = mgr.createQuery(String.format("select from EventData as EventData where BelongsTo = '%s'", username));
              Cursor cursor;
              if (cursorString != null &amp;&amp; cursorString.trim().length() &gt; 0) {
                  cursor = Cursor.fromWebSafeString(cursorString);
                  query.setHint(JPACursorHelper.CURSOR_HINT, cursor);
              }
  
              if (limit != null) {
                  query.setFirstResult(0);
                  query.setMaxResults(limit);
              }
  
              execute = (List&lt;EventData&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 (EventData obj : execute) ;
          } finally {
              if (mgr != null) {
                  mgr.close();
              }
          }
  
          return CollectionResponse.&lt;EventData&gt;builder()
                  .setItems(execute)
                  .setNextPageToken(cursorString)
                  .build();
      }
      /**
       * This method gets the entity having primary key id. It uses HTTP GET method.
       *
       * @param id the primary key of the java bean.
       * @return The entity with primary key id.
       */
      @ApiMethod(name = "getEventData")
      public EventData getEventData(@Named("id") String id) {
          EntityManager mgr = getEntityManager();
          EventData eventData = null;
          try {
              eventData = mgr.find(EventData.class, id);
          } finally {
              mgr.close();
          }
          return eventData;
      }
  
      /**
       * This inserts a new entity into App Engine datastore. If the entity already
       * exists in the datastore, an exception is thrown.
       * It uses HTTP POST method.
       *
       * @param eventData the entity to be inserted.
       * @return The inserted entity.
       */
      @ApiMethod(name = "insertEventData")
      public EventData insertEventData(EventData eventData) {
          EntityManager mgr = getEntityManager();
          try {
              if (containsEventData(eventData)) {
                  throw new EntityExistsException("Object already exists");
              }
              mgr.persist(eventData);
          } finally {
              mgr.close();
          }
          return eventData;
      }
  
      /**
       * This method is used for updating an existing entity. If the entity does not
       * exist in the datastore, an exception is thrown.
       * It uses HTTP PUT method.
       *
       * @param eventData the entity to be updated.
       * @return The updated entity.
       */
      @ApiMethod(name = "updateEventData")
      public EventData updateEventData(EventData eventData) {
          EntityManager mgr = getEntityManager();
          try {
              if (!containsEventData(eventData)) {
                  throw new EntityNotFoundException("Object does not exist");
              }
              mgr.persist(eventData);
          } finally {
              mgr.close();
          }
          return eventData;
      }
  
      /**
       * This method removes the entity with primary key id.
       * It uses HTTP DELETE method.
       *
       * @param id the primary key of the entity to be deleted.
       * @return The deleted entity.
       */
      @ApiMethod(name = "removeEventData")
      public EventData removeEventData(@Named("id") String id) {
          EntityManager mgr = getEntityManager();
          EventData eventData = null;
          try {
              eventData = mgr.find(EventData.class, id);
              mgr.remove(eventData);
          } finally {
              mgr.close();
          }
          return eventData;
      }
  
      private boolean containsEventData(EventData eventData) {
          EntityManager mgr = getEntityManager();
          boolean contains = true;
          try {
              EventData item = mgr.find(EventData.class, eventData.getEventKey());
              if (item == null) {
                  contains = false;
              }
          } finally {
              mgr.close();
          }
          return contains;
      }
  
      private static EntityManager getEntityManager() {
          return EMF.get().createEntityManager();
      }
  
  }
  </code></pre>