Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 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: 1592
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')

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.