title: JPQL query with WHERE on nested fields
body: <p>I have a java entity class UserBean with a list of events:</p>
  
  <pre><code>@OneToMany
  private List&lt;EventBean&gt; events;
  </code></pre>
  
  <p>EventBean has Date variable:</p>
  
  <pre><code>@Temporal(javax.persistence.TemporalType.TIMESTAMP)
  private Date eventDate;
  </code></pre>
  
  <p>Now in UserBean I want to create a NamedQuery that returns all dates that fall within a specific range:</p>
  
  <pre><code>@NamedQuery(name="User.findEventsWithinDates",
              query="SELECT u.events FROM UserBean u WHERE u.name = :name AND u.events.eventDate &gt; :startDate AND u.events.eventDate &lt; :endDate")
  </code></pre>
  
  <p>The above query does not compile though. I get this error:</p>
  
  <pre><code>The state field path 'u.events.eventDate' cannot be resolved to a valid type.
  </code></pre>
  
  <p>By the way, I use EclipseLink version 2.5.0.v20130507-3faac2b.</p>
  
  <p>What can I do to make this query work? Thanks.</p>