title: Finding a count of children entities using JPA CRUD Repository
body: <p>I have been using JPA CRUD repository default methods such as find, findAll, delete, etc. for all my database operations.</p>
  
  <p>Right now I have two entities:</p>
  
  <pre><code>@Entity
  public class Parent implements Serializable {
  
      @Id
      @GeneratedValue
      private long id;
  
      @OneToMany(mappedBy = "parent", cascade = CascadeType.REMOVE)
      private Set&lt;Child&gt; children;
  }
  
  @Entity
  public class Child implements Serializable {
  
      @Id
      @GeneratedValue
      private long id;
  
      @ManyToOne
      @JoinColumn
      private Parent parent;  
  }
  </code></pre>
  
  <p>Is there a way for me to create a new method in ParentRepository that would let me retrieve a count of all the Children of a parent based on the parent's ID?</p>
  
  <p>So inside my ParentRepository, can I create a method that looks something like this:</p>
  
  <pre><code>int findAllChildrenCount(Long parentID);
  </code></pre>