title: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
body: <p>I am trying to execute this query through hibernate. </p>
  
  <pre><code>String queryStr = "from MPRSummaryBean where projId = :projectId and   str_to_date(CONCAT('01','-',month, '-',year),'%d-%M-%Y') "
                          + "in (select max(str_to_date(CONCAT('01','-',month, '-',year),'%d-%M-%Y')) "
                          + "from MPRSummaryBean where projId = :projectId_1 group by projId)";
  </code></pre>
  
  <p>I am getting the following exception.</p>
  
  <pre><code>    java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode 
   \-[METHOD_CALL] MethodNode: '('
      +-[METHOD_NAME] IdentNode: 'CAST' {originalText=CAST}
      \-[EXPR_LIST] SqlNode: 'exprList'
         +-[AGGREGATE] AggregateNode: 'max'
         |  \-[METHOD_CALL] MethodNode: '('
         |     +-[METHOD_NAME] IdentNode: 'str_to_date' {originalText=str_to_date}
         |     \-[EXPR_LIST] SqlNode: 'exprList'
         |        +-[METHOD_CALL] MethodNode: '('
         |        |  +-[METHOD_NAME] IdentNode: 'CONCAT' {originalText=CONCAT}
         |        |  \-[EXPR_LIST] SqlNode: 'exprList'
         |        |     +-[QUOTED_STRING] LiteralNode: ''01''
         |        |     +-[QUOTED_STRING] LiteralNode: ''-''
         |        |     +-[DOT] DotNode: 'mprsummary1_.SUM_MONTH' {propertyName=month,dereferenceType=4,propertyPath=month,path={synthetic-alias}.month,tableAlias=mprsummary1_,className=com.elecnor.mpr.beans.MPRSummaryBean,classAlias=null}
         |        |     |  +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
         |        |     |  \-[IDENT] IdentNode: 'month' {originalText=month}
         |        |     +-[QUOTED_STRING] LiteralNode: ''-''
         |        |     \-[DOT] DotNode: 'mprsummary1_.SUM_YEAR' {propertyName=year,dereferenceType=4,propertyPath=year,path={synthetic-alias}.year,tableAlias=mprsummary1_,className=com.elecnor.mpr.beans.MPRSummaryBean,classAlias=null}
         |        |        +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
         |        |        \-[IDENT] IdentNode: 'year' {originalText=year}
         |        \-[QUOTED_STRING] LiteralNode: ''%d-%M-%Y''
         \-[IDENT] IdentNode: 'DATE' {originalText=DATE}
  </code></pre>
  
  <p>I tried to cast AS DATE, but it didnt work, Can someone please explain me why this is not working and steps to make this work.</p>