title: How to get all elements not present in a @ManyToMany Relationship
body: <p>I am trying to fetch all channels where UserAccount is not present in as admin or follower (-&gt; is not in subscribedUsers &amp; admins collection).</p>
  <p>Those are my entities:</p>
  <pre><code>public class UserAccount {
      @Id ... 
      private long userId;
      
      @JsonIgnore
      @JoinTable(
        name=&quot;user_channel_sub&quot;,
        joinColumns = @JoinColumn(name                 
              =&quot;user_channel_id&quot;,referencedColumnName=&quot;userId&quot;),
          inverseJoinColumns = @JoinColumn(name =              
              &quot;channel_user_id&quot;,referencedColumnName = &quot;channelId&quot;))
      @ManyToMany
      private Collection&lt;Channel&gt; subChannel = new ArrayList&lt;Channel&gt;();
  
      @JoinTable(
              name=&quot;user_channel_admin&quot;,
              joinColumns = @JoinColumn(name = 
                  &quot;user_channel_id&quot;,referencedColumnName= &quot;userId&quot;),
              inverseJoinColumns = @JoinColumn(name = 
                  &quot;channel_user_id&quot;,referencedColumnName = &quot;channelId&quot;))
      @ManyToMany
      private Collection&lt;Channel&gt; adminChannel = new ArrayList&lt;Channel&gt;();
  
      ....
  }
  </code></pre>
  <pre><code>public class Channel {
      @Id
      private channelId;
  
      @ManyToMany(mappedBy=&quot;adminChannel&quot;)
      private Collection&lt;UserAccount&gt; admins  = new ArrayList&lt;UserAccount&gt;();
      
      @ManyToMany(mappedBy = &quot;subChannel&quot;)
      private Collection&lt;UserAccount&gt; subscribedUsers  = new ArrayList&lt;UserAccount&gt;();
  
      ....
  }
  
  </code></pre>
  <p>Repository is a PagingAndSortingRespository.</p>
  <p>I get all channels a user is either follower or admin in by this method (I dont really need it, just wanted to make sure at least something works):</p>
  <p><code>Collection&lt;Channel&gt; findBySubscribedUsers_UserName_OrAdmins_UserName(String uName1,String uName2);</code></p>
  <p>Now when I try the opposite, I get duplicates and yeah basically wrong data:</p>
  <p><code>Collection &lt;Channel&gt; findBySubscribedUsersUserNameNotAndAdminsUserNameNot(String uName1,String uName2);</code></p>
  <p>What am I doing wrong? Is it with this method possible or do I need to use more advanced spring jpa querying methods?</p>