title: DOT node with no left-hand-side using HQL with join
body: <p>I am trying to find the maximum value of a Date column in mySQL DB using hibernate query language with join</p>
  
  <pre><code>@Query("select o.techid, CAST(MAX(o.last_modified) AS DATE) 
     from com.dw.model.user.User as u 
     left join com.dw.model.order.Order as o 
       on u.username=o.techid group by o.techid")
  List&lt;User&gt; findUsers();
  </code></pre>
  
  <p>Model class = </p>
  
  <pre><code>@Entity(name = "orders")
  @Scope("prototype")
  @Component
  @JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class)
  public class Order {
  
      @Id
      private long orderNumber;
  private Date last_modified;
  </code></pre>
  
  <p>I am getting this error :-</p>
  
  <p>Caused by: java.lang.IllegalStateException: DOT node with no left-hand-side!</p>
  
  <p>Can anyone please help me out by telling me how to write this in Hibernate?</p>