title: Spring-Data-JPA Exclude Parameter statement
body: <p>I'm using Spring-Data-JPA and have a 1:n relationship.</p>
  <pre><code>    @Entity
      public class MyFirstEntity {
        @Id
        private long id;
        private String paramA;
        @ManyToOne
        @JoinColumn(name=&quot;id&quot;)
        private MySecondEntity paramB;
        ....
  
      @Entity
      public class MySecondEntity {
        @Id
        private long id;
        private String paramA;
        @OneToMany (fetch = FetchType.LAZY, mappedBy = &quot;paramB&quot;)
        @JoinColumn(name=&quot;id&quot;)
        private Collection&lt;MyFirstEntity&gt; first;
        ....
  </code></pre>
  <p>Now I can define the interface with some extra methods like it is described <a href="http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.details" rel="nofollow noreferrer">here</a>.</p>
  <pre><code>    public interface firstEntityMethods extends CrudRepository&lt;MyFirstEntity, Long&gt; {
        //Example #1
        List&lt;MyFirstEntity&gt; findByParamA (String paramA);
        //Example #2
        List&lt;MyFirstEntity&gt; findByParamAAndParamB (String paramA, MySecondEntity paramB);
        ...
  </code></pre>
  <p>Is it possible to declare such a method to exclude an Parameter. Like <em>findByParamAAndNotByParamB (String paramA, MySecondEntity paramB);</em>?
  So it should find all entities which matches paramA (like example #1) but exclude those which are matching paramB -&gt; (List of Example#1 without List of Example#2).</p>
  <p>PS: above code is example code that you can better understand the question. If there are any mistakes/mistypings please ignore them.</p>