title: Add CriteriaBuilder.between(Date) to Predicate?
body: <p>I am new to JPA</p>
  
  <p>I am trying to query a table where my input date value should be between the startDate and endDate of the database record</p>
  
  <p>I am trying to do:</p>
  
  <pre><code>List&lt;Predicate&gt; conditionsList = new ArrayList&lt;Predicate&gt;();
  conditionsList.add(criteriaBuilder.between(inputDate, root.get("startDate"), root.get("endDate")));
  </code></pre>
  
  <p>I found the below solution from <a href="https://stackoverflow.com/questions/4256561/using-jpa-hibernate-criteria-to-pull-between-a-date">Using JPA/Hibernate Criteria to pull between a date</a>:</p>
  
  <pre><code>ParameterExpression&lt;Date&gt; d = criteriaBuilder.parameter(Date.class);
  criteriaBuilder.between(d, root.&lt;Date&gt;get("startDate"), root.&lt;Date&gt;get("endDate")); 
  </code></pre>
  
  <p>But how to set the Parameterexpression value to inputDate variable value before adding the CriteriaBuilder to the Predicate?</p>