[BioSQL-l] case sensitivity in biosql accessions under BioJavax/Hibernate

James Procter jimp at compbio.dundee.ac.uk
Thu Dec 4 12:19:15 UTC 2008


Thanks for replying...

Richard Holland wrote:
> Hibernate reflects the case-sensitivity of the database it is connected
> to. There's no options in it for changing that, and so you have to use
> it the way the database underneath expects you to.
agreed.

> However, you can modify your queries so that you convert your query
> terms to a specific case in advance of the search using the toUpper() or
> toLower() functions of the String class, then when performing the
> search, use HQL's lower() or upper() functions inside the query HQL to
> convert values to the same case when making the comparisons.
agreed (again).
> 
> Someone will need to search through the BJX code to find the spots where
> explicit queries are made against accessions or any other
> case-insensitive data, then modify it to use the above technique. This
> would possibly involve introducing HQL queries where currently only
> direct Hibernate object references are being made.
ok - this isn't too hard to do. Do you know who currently maintains the
BiojavaX bindings to BJX ?  I can send them patches - or I guess submit
them directly... but.. it wont fix the issue.

In a situation where the backend DB is case sensitive, new accessions
inserted into the DB must be forced to be the same case in the same way
as the accession query string will be forced to be. This modification is
again straightforward, but the case change would also have to be
propagated to existing entries in the BioSQL. Furthermore, modifying the
Biojava-x bindings would only ensure case-insensitivity for Biojava
queries, the same modification would also be necessary for the other
bio-* bindings.

This isn't actually a burning issue for me at the moment even though it
might sound like it from the way I'm posting about it - I had already
hacked biojava-x to accomodate the case for my specific BioSQL database.
However, it is important to clarify this situation in order to ensure
interoperability between biosql databases and off the shelf middleware.

all the best!
Jim




More information about the BioSQL-l mailing list