-->
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 case sensitive comparison
PostPosted: Wed Jul 26, 2017 8:57 am 
Newbie

Joined: Wed Jul 26, 2017 8:56 am
Posts: 1
Is there case sensitive comparsion in HQL ? eg.:

FROM Foo as a WHERE a.property='Any WoRdS'

I can use "binary" keywords in Hibernate 2 - in HQL - that was right for me, when I use that the result was good.

I would like that the comparsion only will be true if the property's String exatly equals to 'Any WoRdS'.
Is it possible?


Top
 Profile  
 
 Post subject: Re: sensitive comparsion
PostPosted: Wed Jul 26, 2017 9:30 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
The equality operation stands for exact matching.

If you want to compare without taking into consideration the case, then use LOWER:

Code:
select a
FROM Foo as a
WHERE LOWER(a.property) = LOWER('Any WoRdS')


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.