title: HQL query for searching (one to many relation)
body: <p>I have two entities, Book and Author.</p>
  
  <pre><code>@Entity
  @Table(name="book") 
  class Book {
      private int id;
      private Map&lt;Integer, Author&gt; authors = new HashMap&lt;Integer, Author&gt;();
  
      @Id
      @GeneratedValue
      @Column(name="id_book")
      public int getId() {
          return this.id;
      }
  
      @OneToMany(fetch=FetchType.EAGER)
      @JoinTable(name="book_author", joinColumns= {@JoinColumn(name="id_book")},
              inverseJoinColumns = {@JoinColumn(name="id_author", table="author")})
      @MapKeyColumn(name="order")
      public Map&lt;Integer, Author&gt; getAuthors() {
          return authors;
      }
  
  
  }
  
  @Entity
  @Table(name="author")
  class Author {
  
      private int id;
      private String lastname;
      private String firstname;
  
      @Id
      @Column(name="id_author")
      @GeneratedValue
      public int getId() {
          return id;
      }
  
      public String getLastname() {
          return lastname;
      }
  
      public String getFirstname() {
          return firstname;
      }
  
  }
  </code></pre>
  
  <p>A book has many authors listed in a particular order. Now I am trying to create a HQL such that I can get a list of book from a particular author with particular firstname or lastname or both. I am confused on how to use join between two entities. Any idea?</p>
  
  <p>Thanks in advance.</p>