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.  [ 4 posts ] 
Author Message
 Post subject: HQL case insensitive and also escape special characters?
PostPosted: Mon Feb 22, 2010 5:36 am 
Newbie

Joined: Thu Dec 03, 2009 1:37 pm
Posts: 7
Hi,

I am writing CriteriaQuery. To escape special characters such as '[' I use Restrictions.Like(string propertyName, string value, MatchMode matchMode, char? escapeChar);
It is working fine for all Databases.

But now I want to add CaseInsensitivity. For this I have found the function Restrictions.InsensitiveLike(string propertyName, string value, MatchMode matchMode);

but this function does not contain escapeChar parameter. So I can not escape special characters.

Is there any way to make the HQL case insensitive and also escape special characters?

Thanks in Advance.

Regards,
Niranjan


Top
 Profile  
 
 Post subject: Re: HQL case insensitive and also escape special characters?
PostPosted: Tue Feb 23, 2010 3:46 pm 
Beginner
Beginner

Joined: Tue Aug 25, 2009 11:42 am
Posts: 49
I am not sure if I am being very helpful but in case u have no need for case sensitive "like"s throughout your application, u might turn case-sensitivity off at your database instead of hibernate. Most databases have such a feature.


Top
 Profile  
 
 Post subject: Re: HQL case insensitive and also escape special characters?
PostPosted: Wed Mar 03, 2010 6:06 am 
Newbie

Joined: Thu Dec 03, 2009 1:37 pm
Posts: 7
Hi,

Thanks for the reply.

I dont want to do any database specific things. Otherwise I have to do those changes in all databases.

If I can get the function such as Restrictions.Like(string propertyName, string value, MatchMode matchMode, char? escapeChar); for Restrictions.InsensitiveLike then I think it would be better.

Hope NHibernate guys will provide this functionality soon.

Regards,
Niranjan


Top
 Profile  
 
 Post subject: Re: HQL case insensitive and also escape special characters?
PostPosted: Wed Mar 10, 2010 6:28 am 
Newbie

Joined: Thu Dec 03, 2009 1:37 pm
Posts: 7
Hi,

Is there any updates on the issue?

Regards,
Niranjan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.