Using Hibernate 2.1.2 against Oracle 9. It's a generic problem so I haven't included mappings yet...
I want to construct a like clause in OQL to retrieve rows where the value in a field starts with the percent character. In JDBC, I would write this:
select * from table_name where field_name like '&%%' {escape '&'}
So I tried this in OQL:
select b1 from b1 in class test.Blah where b1.name like '&%%' {escape '&'}
But this gets translated by Hibernate into this:
select b1.id as x0_0_ from djones.blah b1 where (b1.name like '&%%' {escape '&' } )
This is not a valid JDBC SQL statement.
I think the problem may be related to a bug with named SQL queries on JIRA:
http://opensource.atlassian.com/project ... wse/HB-898
But thought I'd ask here if there is a different way to formulate this particular LIKE query in OQL.
Thanks in advance,
DJ