java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.AggregateNode

hello

I am trying to run the HQL in my java code -
select max(cast(sp.barcode as unsigned)) as num from edu.wustl.catissuecore.domain.Specimen as sp

It throws me foll. error -
Caused by: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.AggregateNode
-[AGGREGATE] AggregateNode: ‘max’
-[METHOD_CALL] MethodNode: ‘(’
±[METHOD_NAME] IdentNode: ‘cast’ {originalText=cast}
-[EXPR_LIST] SqlNode: ‘exprList’
±[DOT] DotNode: ‘specimen0_.BARCODE’ {propertyName=barcode,dereferenceType=4,propertyPath=barcode,path=sp.barcode,tableAlias=specimen0_,className=edu.wustl.catissuecore.domain.Specimen,classAlias=sp}
| ±[ALIAS_REF] IdentNode: ‘specimen0_.IDENTIFIER’ {alias=sp, className=edu.wustl.catissuecore.domain.Specimen, tableAlias=specimen0_}
| -[IDENT] IdentNode: ‘barcode’ {originalText=barcode}
-[IDENT] IdentNode: ‘unsigned’ {originalText=unsigned}

    at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:140)
    at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:702)
    at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:531)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
    at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
    at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
    at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
    at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
    at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
    at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
    at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
    at gov.nih.nci.system.dao.impl.orm.ORMDAOImpl.query(ORMDAOImpl.java:225)

Can anyone please help me on this.
Thanks,
Nitin

probably the issue is the cast type unsigned , see Hibernate ORM 6.1.1.Final User Guide