-->
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: regexp in hql
PostPosted: Tue Jan 16, 2007 4:19 am 
Newbie

Joined: Tue Mar 08, 2005 2:01 am
Posts: 1
Hi

I'm using hibernate.3.2.0.cr2

I want to write a query that looks like this:

session.createQuery( "select * from contact where emailAddress REGEXP :filter )
.setString( "filter", "[^" + getFilter() + "]" );

getFilter() can return 'a' or 'b' ( any character in the alphabet) or '0-9'

any help will be appreciated.

thanks
sophia


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 6:26 am 
Senior
Senior

Joined: Mon Oct 23, 2006 5:12 am
Posts: 141
Location: Galicia, Spain
REGEXP is not SQL standard (i guess you are using MySQL?), so i think you must use

session.createSQLQuery()

_________________
andresgr (--don't forget to rate)


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.