title: Logical OR between a Criterion and Criteria
body: <p>I have the following model classes:</p>
  
  <pre><code>@Entity
  @Table(name = "title")
  public final class Title extends ModelData&lt;Title&gt;
  {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Integer titleID;
  
      @Column(name = "title")
      private String title;
  
      @Column(name = "description")
      private String description;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "title")
      private Set&lt;Book&gt; books;
  }
  
  @Entity
  @Table(name = "book")
  public final class Book extends ModelData&lt;Book&gt;
  {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "bookID")
      private int bookID;
  
      @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
      @JoinColumn(name = "titleID")
      private Title title;
  
      @Column(name = "edition")
      private Integer edition;
  
      @Column(name = "isbn")
      private String ISBN;
  }
  </code></pre>
  
  <p>I want to write a Criteria query that is equivalent to the following SQL;   </p>
  
  <pre><code>Select 
          t.title, b.edition 
      from 
          books b, title t
      where 
          b.titleID = t.titleID
      and 
          (b.edition=4 OR t.title LIKE '%Java%);
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>Criteria c = session.createCriteria(Book.class);
  
  Criteria titleCriteria = c.createCriteria("title");
  titleCriteria.add(Restrictions.like("title", "%Java%");
  
  Criterion edition = Restrictions.eq("edition", 4);
  
  LogicalExpression orExp = Restrictions.or(edition, titleCriteria); //cannot do this
  </code></pre>
  
  <p>How do I achieve the above?</p>
  
  <p>Thanks.</p>