title: Java play framework 2.0.4 ebean query
body: <p>I am wondering how to query the database using the model in play 2.0 with a query like the one I listed below. I didn't see an option to pass in direct sql into the play framework 2.0.</p>
  
  <p>I am trying to get a list of the expenses from a particular month. </p>
  
  <pre><code>SELECT * FROM Expensesdb.expense
  WHERE month(expense.purchase_date) = 01
  </code></pre>
  
  <p>The option I see is to query for all the expenses and then parse each one for the month they are listed using the Date object. </p>
  
  <p>I think there should be an efficient way, I can't seem to find a way to do this using ebean with Java play framework 2.0 to perform this query. </p>
  
  <p><strong>Update</strong></p>
  
  <p>Thanks Nico, I tried the exact code you have, with DateTime and I tried to use the code below, it doesn't return any Expenses. Am I doing something wrong?</p>
  
  <pre><code>    Calendar calendar = Calendar.getInstance();
      calendar.set(2012, 0, 01);
  
      Date startDate = calendar.getTime();
      calendar.set(2012, 0, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
  
      Date endDate = calendar.getTime();
      List&lt;Expense&gt; expenses = find.where().between("purchaseDate", startDate, endDate).findList();
      return expenses;
  </code></pre>