-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate Criteria Searches and MS SQL Server Case Insens.
PostPosted: Sun May 08, 2005 2:45 pm 
Newbie

Joined: Sun May 08, 2005 2:33 pm
Posts: 6
Hi All,

When I do a search using a Criteria and Example objects, it of course ignores letter case due to MS SQL Server case-insensitiviy by default.
For example, the following code:

Criteria c = s.createCriteria(Invoice.class);
Invoice exampleInvoice = new Invoice();
exampleInvoice.setName("Denis");
c.add(Example.create(exampleInvoice));
c.list()

will also return invoices with names "denis" or "DENIS".

However, this kinda affects Hibernate's cross-database portability and makes Example.ignoreCase() method actually depending on the database being used. For example, my code may stop working once I move to a database that is case sensitive by default.

Can all SQL Dialects, including SQL Server's one, be changed to do case sensitiviy by default and thus increase the portability? If I say "exampleInvoice.setName("Denis");" then I want to get invoices with names exactly "Denis" and i do not want to know or worry about underlying database specifics and I do not want to get bugs once database server has been changed.

Thanks.

Denis.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.