下面是我写的dao类里的方法:public String findMaxEndNum(String areaNo, Integer cardTypeId){ String endNumResult = ""; String hql = "select MAX(Cast(cardApply.endNum AS Integer)) from CardApply as cardApply " + "where cardApply.areaNo = '"+areaNo+"' and cardApply.cardTypeId='"+cardTypeId+"'"; List list = this.queryByHQL(hql); System.out.println(list.get(0)); if(list!=null&&list.size()>0){ endNumResult = (String)list.get(0); System.out.println(endNumResult); } return endNumResult; }下面是调用这个方法报的错2010-11-23 06:01:30,204 ERROR (StandardWrapperValve.java:253) - Servlet.service() for servlet action threw exceptionjava.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.AggregateNode \-[AGGREGATE] AggregateNode: 'MAX' \-[METHOD_CALL] MethodNode: '(' +-[METHOD_NAME] IdentNode: 'Cast' {originalText=Cast} \-[EXPR_LIST] SqlNode: 'exprList' +-[DOT] DotNode: 'cardapply0_.EndNum' {propertyName=endNum,dereferenceType=4,propertyPath=endNum,path=cardApply.endNum,tableAlias=cardapply0_,className=cn.eainfo.com.card.po.CardApply,classAlias=cardApply} | +-[ALIAS_REF] IdentNode: 'cardapply0_.ApplyID' {alias=cardApply, className=cn.eainfo.com.card.po.CardApply, tableAlias=cardapply0_} | \-[IDENT] IdentNode: 'endNum' {originalText=endNum} \-[IDENT] IdentNode: 'Integer' {originalText=Integer}