title: Spring Data JPA Query method to find all objects with empty list property
body: <p>I have an entity which contains a property that is a list:</p>
  
  <pre><code>@Entity
  @Table(name="sales.jobs")
  public class Job {
      ...
      private List&lt;Shipment&gt; jobShipments;
      ...
      @OneToMany(cascade=CascadeType.ALL,orphanRemoval=true, fetch=FetchType.LAZY)
      @JoinTable(name="sales.jobs_shipments",
             joinColumns = @JoinColumn(name="fk_jobid", referencedColumnName="pk_jobid"),
             inverseJoinColumns = @JoinColumn(name="fk_shipmentid", referencedColumnName="pk_shipmentid"))
      public List&lt;Shipment&gt; getJobShipments() {
          return jobShipments;
      }
  
      public void setJobShipments(List&lt;Shipment&gt; jobShipments) {
          this.jobShipments = jobShipments;
      }
      ...
  }
  </code></pre>
  
  <p>In the repository, I would like to have a query method which returns all jobs where <code>jobShipments</code> is an empty list.  I had first tried the <code>IsNull</code> keyword as shown below, but that doesn't work because if there are no shipments it is an empty list rather than null.</p>
  
  <pre><code>@Repository
  public interface JobRepository extends CrudRepository&lt;Job, Integer&gt; {
      Page&lt;Job&gt; findByJobShipmentsIsNull(Pageable pageable);
  }
  </code></pre>
  
  <p>I looked through the keywords in the documentation hoping to find something like <code>IsEmpty</code>, but I couldn't find anything that looked right.</p>
  
  <p>I am looking for an answer that uses keywords rather than writing out a query, but I suppose that would be the fallback.  Thanks!</p>