I have a similar question...
I am using Hibernate Persistence to access a Postegres 9.0 database. Postgres 9.0 support a '~' operator that may be used instead of LIKE to do POSIX regular expression (regexp) matches on string columns if a table. Is there some way that I can use the '~' operator from hibernate persistence EJBQL queries or use the POSIX regexp matching somehow?
Here is a simple example to illustrate what I am looking for:
Query with LIKE (already supported):
Code:
SELECT Object(bar) FROM foo.Bar bar WHERE bar.name LIKE '%acme%';
Query with POSIX RegExp (not supported)
Code:
SELECT Object(bar) FROM foo.Bar bar WHERE bar.name ~ '.*acme.*';