|
Hello Hibernate gurus,
I was wondering if Hibernate offers any support for regular expressions when performing database queries. Specifically, I would like to perform the following...
I have a table in my database that stores contact information and contains a field for a phone number (among other things). Say a user of the system would like to look up the information for a contact using a supplied phone number as the search criteria (e.g. 123-4567, 123.4567, 1234567). I would like to perform a query similar to the following using Hibernate but I am unsure of how to proceed (other than using a direct SQL query):
select * from contacts where phone_number regex '123[^0-9]*4567';
Direct support for regular expressions notwithstanding, is there a way to mimic regular expression support using either the Criteria or Query classes?
Thanks in advance,
Rodney
|