title: Creating multiple aliases for the same QueryDSL path in Spring Data
body: <p>I have a generic Spring Data repository interface that extends <code>QuerydslBinderCustomizer</code>, allowing me to customize the query execution.  I am trying to extend the basic equality testing built into the default repository implementation, so that I can perform other query operations using Spring Data REST.  For example:</p>
  
  <pre><code>GET /api/persons?name=Joe%20Smith  // This works by default
  GET /api/persons?nameEndsWith=Smith  // This requires custom parameter binding.
  </code></pre>
  
  <p>The problem I am having is that every alias of an entity path I create seems to override the preceding alias bindings.</p>
  
  <pre><code>@NoRepositoryBean
  public interface BaseRepository&lt;T, ID extends Serializable&gt;
      extends PagingAndSortingRepository&lt;T, ID&gt;, QueryDslPredicateExecutor&lt;T&gt;, QuerydslBinderCustomizer { 
  
      @Override
      @SuppressWarnings("unchecked")
      default void customize(QuerydslBindings bindings, EntityPath entityPath){
  
          Class&lt;T&gt; model = entityPath.getType();
          Path&lt;T&gt; root = entityPath.getRoot();
          for (Field field: model.getDeclaredFields()){
              if (field.isSynthetic()) continue;
              Class&lt;?&gt; fieldType = field.getType();
              if (fieldType.isAssignableFrom(String.class)){
                  // This binding works by itself, but not after the next one is added
                  bindings.bind(Expressions.stringPath(root, field.getName()))
                          .as(field.getName()  + "EndsWith")
                          .first((path, value) -&gt; {
                              return path.endsWith(value);
                          });
                  // This binding overrides the previous one
                  bindings.bind(Expressions.stringPath(root, field.getName()))
                          .as(field.getName()  + "StartsWith")
                          .first((path, value) -&gt; {
                              return path.startsWith(value);
                          });
              }
          }
      }
  }
  </code></pre>
  
  <p>Is it possible to create more than one alias for the same field?  Can this be accomplished in a generic way?</p>