-->
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: HQL to SQL with chinese. Hibernate 3.3.2 GA
PostPosted: Mon Nov 23, 2009 9:57 am 
Newbie

Joined: Mon Nov 23, 2009 9:49 am
Posts: 1
Hello.

We are using Hibernate to get objects from Oracle SQL DB.
We are using UTF-8 Database encoding with JAVA.

We have HQL query like this:

DEBUG {934335468@127.0.0.1/POST} org.hibernate.hql.ast.QueryTranslatorImpl - HQL: select changeRequest from ChangeRequestBrief as changeRequest where upper(changeRequest.evidenceNumber) like '你好%'ESCAPE'\'

But this query get's translated to:
DEBUG {934335468@127.0.0.1/POST} org.hibernate.hql.ast.QueryTranslatorImpl - SQL: select changerequ0_.CHNG_REQ_ID as CHNG1_, changerequ0_.EVIDENCE_NR as EVIDENCE2_42_, changerequ0_.RECEIVED_DATE as RECEIVED3_42_, changerequ0_.ORIG_REF_NR as ORIG4_42_, changerequ0_.ORG_ID as ORG5_42_, changerequ0_.COPY_TO as COPY6_42_, changerequ0_.STATE_ID as STATE7_42_, changerequ0_.USER_ID as USER8_42_, changerequ0_.INS_DATE as INS9_42_, nvl((SELECT susers.user_name FROM susers WHERE susers.user_id = changerequ0_.user_id),'Unknown User (' || changerequ0_.user_id || ')') as formula15_ from SCHNG_REQ changerequ0_ where (upper(changerequ0_.EVIDENCE_NR)like '??%' escape '\')


The like '??%' are real '?'. Cheched in HEX editor. it is 0x3F 0x3F.

I am logging to file with UTF-8. So logs are OK.

With normal JAVA oracle SQL connection I can filter by chinese chars.

So problem is with HQL to SQL translate.

Any suggestions.


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.