title: How to get child table rows using parent table ID?
body: <p>I have two tables: Organization(Parent) and Department(Child).</p>
  
  <p>There is One to Many relationship, and is mentioned in Organization table only.</p>
  
  <pre><code>@Entity
  @Table(name="TBL_STD_ORGANIZATION")
  public class Organization implements Serializable  {
    @Id
    @GeneratedValue
    @Column(name="FLD_ORG_ID")
    private Long organizationId;
  
    @Column(name="FLD_ORG_NAME")
    private String orgName;
  
    @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    private java.util.List&lt;Department&gt; listOfDepartMents = new java.util.ArrayList&lt;Department&gt;();
  }
  </code></pre>
  
  <p>Below is Department Class:</p>
  
  <pre><code>    @Entity
      @Table(name="TBL_STD_DEPARTMENT")
      public class Department implements Serializable { 
  
      @Id
      @GeneratedValue
      @Column(name = "FLD_DEPARTMENT_ID")
      private Long departmentId;
  
      @Column(name = "FLD_DEPARTMENT_NAME")
      private String departmentName;
      }
  </code></pre>
  
  <p>I wrote relationship in Parent table, because of it hibernate creates third table.
  Now, I have to retrieve departments start with "sa" keyword and in specific organization.
  So I want the HQL or SQL query query. I am not getting it how to write such complex query.
  Any suggestions?</p>