users@glassfish.java.net

Re: jpql Query ignore case

From: Johnny Tolliver <jxt_at_ornl.gov>
Date: Thu, 1 May 2008 10:48:47 -0400 (EDT)

On Wed, 30 Apr 2008, Mitesh Meswani wrote:

> How about using COLLATE clause for column defin ? That forces MySQL to
> do can sensitive comparison
>
> For example create table temp (col1 varchar(30) COLLATE latin1_bin)

Thanks, I didn't know that. I'm using MySQL because I'm only 95% ignorant
about MySQL compared to 100% ignorant about the other choices.

However, I'm not creating my tables manually; instead I'm letting JPA create
them for me as needed from annotations in the POJO entity classes with
toplink.ddl-generation set to create-tables in the persistence unit. Is
there some JPA annotation to accomplish the same result? Looking at the docs
it appears that something like

    @Column(columnDefinition="COLLATE latin1_bin")

might work. I'll try that. Any thoughts?

Johnny S. Tolliver
Oak Ridge National Laboratory
tolliverjs_at_ornl.gov, 865-574-1305