You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Stefan Schlösser <ss...@intermediate.de> on 2004/02/19 13:51:51 UTC

How to do a not casesensitive string equal Criteria ?

Hi,

I'd like to formulate a Criteria

crit.addEqualTo("meinStringField", "mytext");

which should match MYTEXT, mytext, MyText etc. i.e. a incasesensitive
match.
How do I do that using ojb (without resorting to tablecolumn names or
straight sql) ?
By the way, I am using SAPDB and HSQL

Thanks for your help,

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: How to do a not casesensitive string equal Criteria ?

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
SapDB doesn't make case insensitive queries.

I've implemented this using a custom Conversion that assure the fields are
stored/read always in uppercase.
If this solution works for you, you could check docs about how to create a
custom conversion, then apply this in the repository.xml for the field.

Using conversions, when querying the OJB apply same rules for the criteria
parameters. This stuff works like a charm.

For some tables, that I need to query case/accent insensitive but need to
show data with accent/case preserved, I've created a conversion, and I store
the data in two columns: one with conversion applyied, other without
conversion. May be this a waste of space, but remember: this is bound to
database you are using. In MS SQL Server, as example, you don't have this
problem.

Best regards,

Edson Richter



----- Original Message ----- 
From: Stefan Schlösser
To: OJB Users List
Sent: Thursday, February 19, 2004 9:51 AM
Subject: How to do a not casesensitive string equal Criteria ?


Hi,

I'd like to formulate a Criteria

crit.addEqualTo("meinStringField", "mytext");

which should match MYTEXT, mytext, MyText etc. i.e. a incasesensitive
match.
How do I do that using ojb (without resorting to tablecolumn names or
straight sql) ?
By the way, I am using SAPDB and HSQL

Thanks for your help,

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.591 / Virus Database: 374 - Release Date: 17/2/2004


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org