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

Richard Holland holland at eaglegenomics.com
Thu Dec 4 11:43:10 UTC 2008


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.

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.

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.

cheers,
Richard


James Procter wrote:
> Thanks for the reply - Mark.
> 
> Mark Schreiber wrote:
>> Are there any situations where Accessions would not be case
>> insensitive? 
> AFAIK the public sequence, structure and gene id databases all have case
> insensitive Accessions, so I'd reckon 'No' being the answer there.
> However, its easy to imagine that some legacy in-house databases relying
> on case sensitivity in some way.
> I feel they should be case-insensitive but partly this is
>> going to depend on Hibernates default behaivor and the default of the
>> underlying DB. Some DB's are case insensitive by default if this is
>> the case then hibernates behaivour will probably not impact this.
> Again, agreed.
> 
> Assuming for the moment that accessions are case insensitive in BioSQL,
> then case sensitivity should also be built into the BioSQL schema
> implementations for each DB, and a case insensitive column should be
> used if the DB supports it. However, regardless of whether the DB
> supports that kind of attribution, the language bindings should also
> have the case-insensitivity built in. In the case of Hibernate, the
> bindings have to be matched to the underlying database anyway, so I
> guess the problem I encountered is really due to a bug in the biojavax
> schema.
> 
> of course - if case insensitivity isn't in the BioSQL spec - then its
> all immaterial, so the question still remains.  Can anyone enlighten us
> further ?
> 
> Jim
> 
> ps. I've started another thread for the reply regarding biosql/Bio*
> object mappings.
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biosql-l
> 

-- 
Richard Holland, BSc MBCS
Finance Director, Eagle Genomics Ltd
M: +44 7500 438846 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/



More information about the BioSQL-l mailing list