-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How can I use regular expression in HQL
PostPosted: Mon Oct 16, 2006 12:06 pm 
Newbie

Joined: Sun Oct 15, 2006 11:20 pm
Posts: 13
I am using Hibernate with MySQL.

From MySQL documentation, it supports regular expression:
http://dev.mysql.com/doc/refman/5.0/en/regexp.html

My question is how can I use regular expression in HQL?
Or do I have to use Native SQL for query if I need to use regular expression.

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 9:08 pm 
Newbie

Joined: Tue Oct 17, 2006 9:53 pm
Posts: 3
If you don't mind editing a few Hibernate source files and rebuilding the Hibernate jar file, you can add support for MySQL's rlike operator (the regular expression operator) fairly easily. See my description of how to do this at:

http://wordhoard.northwestern.edu/userman/hibernatechanges.html

I have used these changes with only minor modifications since the first releases of Hibernate based upon ANTLR. The changes work fine (for me, anyway) in Hibernate 320 ga.

_________________
Philip R. "Pib" Burns
Northwestern University, Evanston, IL. USA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.