I\'m using Hibernate 3 with SQL Server 2008. I want to do case sensitive search in Hibernate Criteria. I\'m not able to achieve it. My code is as below:
Crit
You can't with hibernate. Problem is in MS SQL - by default it use case insensitive collation. There can be two workarounds:
1 Select with hibernate and do program filtering of result
2 When create table use case sensitive collation for filed you nead to search: COLLATE SQL_Latin1_General_CP850_BIN2 or other specified for your server (read from SYSTEMPROPERTY).