I just wanted to give feedback how I solved that problem:
Since I didn't know how to define the collation in my JPA queries I decided to change the column definition to utf8_bin. I guess that's the better choice anyway because utf8_general_ci treats 'a' and 'ä' as the same character.

Cheers,
Christopher


Am 05.09.2011 03:38, schrieb No1UNo:
Can't provide much help, but I can testify to having done similar exercises 
with OpenJAP 2.0 and 2.1 using PostgreSQL without any problem.  I recommend 
logging your SQL statements and verifying that the character encodings are 
passing through correctly.

On Aug 31, 2011, at 12:53 PM, Christopher Cudennec [via OpenJPA] wrote:

Hi!

I have a simple (?) problem with a query against data with German umlaut 
characters.

Consider the following data:

create table test (property varchar(255));
insert into test values ('Diskontsatze');
insert into test values ('Diskontsätze');
select * from test where prop = 'Diskontsatze';

When querying the database using SQL I get one row as expected. When using the 
same query with OpenJPA I unexpectedly get two rows. It looks like OpenJPA uses 
another collation than my table and database.

As database I use MySQL. The default-character-set is "utf8". I tried to set 
the collation for the table explicitly to 'utf8_unicode_ci' without any positive result.

What could be the problem?

Thanks,

Christopher
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!       
Jetzt informieren: http://www.gmx.net/de/go/freephone


If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/problem-with-query-German-umlaut-tp6747336p6747336.html
To start a new topic under OpenJPA Users, email 
ml-node+208411-1703014788-244...@n2.nabble.com
To unsubscribe from OpenJPA Users, click here.


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/problem-with-query-German-umlaut-tp6747336p6759586.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to