-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: DetachedCriteria while using order by (charset problem)
PostPosted: Tue Jul 02, 2013 7:39 am 
Newbie

Joined: Tue Jul 02, 2013 7:12 am
Posts: 1
Hi,

I'm using db2 as the database and DetachedCriteria for selecting some rows but facing problem while sorting the records. (As usual, there is a java model matching to SampleTable. Assume SampleTable has 3 columns: col1, col2, col3) The varchar column (col3) of the table contains some letters different from English alphabet (such as "ç","ş","ü","ö") The order by clause on col3 results in ordering the results in a weird way. The columns starting with the letters "ç","ş","ü","ö" are listed first and the columns starting with "a","b","c","d" are listed after those records. In fact, in the alphabet we use, "ç" is after "c" and "ş" after "s". So the resulting list is in wrong order..

the suggested solution from IBM is using "collation_key" keyword. The usage is below:
SELECT col1, col2, col3 FROM SampleSchema.SampleTable ORDER BY collation_key(col3, 'UCA410_LTR_NO', 2500);

My problem is passing "collation_key(col3, 'UCA410_LTR_NO', 2500)" phrase to hibernate in DetachedCriteria.. How do I pass this parameter/phrase to hibernate?

Or any other ideas such as setting locale or using hql or whatever else.. How do I overcome this problem??


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.