title: CriteriaQuery month and year filter
body: <p>I'm trying to make a criteria query (JPA/Hibernate)in a model which contain one column with date (Oracle 11G) . For example, i have </p>
  
  <ol>
  <li>13-JAN-09</li>
  <li>15-JAN-09 </li>
  <li>16-MAR-09</li>
  </ol>
  
  <p>And my function is like:</p>
  
  <pre><code>public MyEntity getEntitiesFromCertainFilters(int a, int b, java.util.date c)
  {
      CriteriaBuilder builder = entityManager.getCriteriaBuilder();
      CriteriaQuery&lt; MyEntity &gt; query = builder.createQuery(MyEntity.class);
      Root&lt; MyEntity &gt; root = query.from(MyEntity.class);
  
      query.select(root).where (
          builder.equal ( root.get ( "id" ).get ( "codEstablec" ) , establecimiento),
          builder.equal ( root.get ( "id" ).get ( "correlGrupo" ) , correlGrupo),
          //HERE I NEED TO ADD FILTER BY C.MONTH AND C.YEAR FROM THE DATE ATTRIBUTE
          );
  
      List &lt; MyEntity &gt; resultList = entityManager.createQuery(query).getResultList();  
      return resultList.get(0);
  }
  </code></pre>
  
  <p>If i want to filter by c = "01-JAN-09", it should return:</p>
  
  <ol>
  <li>13-JAN-09</li>
  <li>15-JAN-09 </li>
  </ol>
  
  <p>Any help would be really appreciated,
  thanks in advance.</p>