hql to_number
select max(cast(o.ordernum,int)) from className o
or
select max(cast(o.ordernum as int)) from className o
select max(cast(o.ordernum,int)) from className o
or
select max(cast(o.ordernum as int)) from className o