-->
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: Hibernate criteria with Regular Expressions ?
PostPosted: Tue Jun 03, 2008 11:59 am 
Newbie

Joined: Sun Apr 20, 2008 8:11 pm
Posts: 10
Hi,

Is there any way to support regular expressions while using Hibernate, I mean for a criteria something like this:


Code:
List cats = sess.createCriteria(Cat.class)
    .add( Restrictions.in( "name", "\\myCat\\b*") )
    .list();


It would be awesome....

Many thanks for any answer !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 10:16 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I think we're really limited to the Restrictions object, and all of its various methods. There are alot though!

JavaDoc for restrictions class:

http://www.hibernate.org/hib_docs/v3/api/org/hibernate/criterion/Restrictions.html

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.