I am using oracle 10g
and hibernate 3.3.2
. I have used regular expression in sql before, now for the first time I am using it in HQL.
Query query = getSession().createQuery("From Company company
where company.id!=:companyId and
regexp_like(upper(rtrim(ltrim(company.num))), '^0*514619915$' )");
This is my hql, when i run it without regex_like
function it runs as expected. But I am not able to execute it with regex_like
expression.
It says..
nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 66.....
Kindly help, how can I use regex_like
in hibernate native query? OR some other alternative to do so.