-->
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: Expression.eq( ... usage for case insesitive
PostPosted: Mon Feb 06, 2006 4:07 pm 
Newbie

Joined: Mon Feb 06, 2006 4:00 pm
Posts: 5
Hi,

I am trying to use Expression.eq in Criteria. I don't find any option that using for case insesitive for "equal" operation in API.

Can anyone suggest on this.

Thanks
Raju.M


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 06, 2006 4:16 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I don't konw of any databases that allow for case-insensitive comparisons. The ref docs have exactly what you're looking for in section 15.2:
Code:
List cats = sess.createCriteria(Cat.class)
    .add( Restrictions.sqlRestriction("lower({alias}.name) like lower(?)", "Fritz%", Hibernate.STRING) )
    .list();


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.