title: Filter Rows in Join Table - Many to Many in Hibernate
body: <p>I'm trying to implement a soft delete across my entire platform. Each table has a <code>deleted_on</code> column that will be used to filter out deleted rows. </p>
  
  <p>This includes the join table that I have that's between my files and users. I haven't had any luck finding anything that could help. Right now my classes look like this</p>
  
  <pre><code>@Entity
  public class File {
  
      @ManyToMany
      @JoinTable(
          name = "file_user",
          joinColumns = @JoinColumn(name = "file_id", referencedColumnName = "file_id"),
          inverseJoinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")
      )
      private List&lt;User&gt; users;
  
      // Constructor and other fields
  }
  </code></pre>
  
  <p>User class:</p>
  
  <pre><code>@Entity
  public class User {
  
      @ManyToMany(mappedBy = "users")
      private List&lt;FileData&gt; files = new ArrayList&lt;&gt;();
  
      // Constructor and other fields
  }
  </code></pre>
  
  <p>If it's possible I would like to be able to run the following code without filtering it in the business code</p>
  
  <pre><code>File file = fileRepository.findOne(fileKey);
  file.getUsers().remove(user);
  fileRepository.save(file);
  </code></pre>