-->
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: Implementing OracleDialect for case-insensitive search
PostPosted: Thu Jan 18, 2007 7:46 am 
Newbie

Joined: Thu Jan 18, 2007 7:36 am
Posts: 3
Location: Belarus
We need to support consistent search behavior of our applications across different DB systems.
Generally search for objects by String fields in search pattern is expected to work like this:
customerId customerName
1 test
2 Test

Search for customer by customer.name = 'test' should return 1 AND 2 as results in all cases.
This is a problem on Oracle case sensitive systems however, where only 1 is returned.

To avoid this, Oracle allows to create function based indexes:
create index upper_name on customer ( upper(name));

Then query below should be used:
select customerId from customer where upper(name) = ?

Can it be implemented for all indexed columns by extending OracleDialect?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 24, 2007 11:34 am 
Newbie

Joined: Thu Jan 18, 2007 7:36 am
Posts: 3
Location: Belarus
While was searching solution, found two other ways of case-insensitive search in Oracle.
1) For Oracle 10 it can be implemented by setting special
system environment variables: NLS_COMP and NLS_SORT
http://www.orafaq.com/node/91.
2) When using Criteria API call ignoreCase() method - it will generate lower function in sql when comparing strings.


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.