java - Regex query in Hibernate -


i want achieve effect of following query in hibernate, i'm unable figure out way this.

select e.title events e e.title regexp 'fri|pro'; 

can help?

hibernate ql doesn't support regular expressions (and engines have poor regexes support). can transform query be

select e.title events e (e.title = 'fri' or e.title = 'pro'); 

or

select e.title events e e.title in ('fri','pro'); 

but real regex support you'll have write custom sql (if db support regexes @ all)


Comments