Issue
I am using hindi characters in where clause in JPA query. When I print the queries in console using show jpa the chars are being replaced by ????
.
value="${jdbc.url};databaseName=${jdbc.databaseName};useUnicode=true;characterEncoding=UTF-8"
In jdbc url but its not solving the problem.
Following the console output.
Hibernate: select facilitysc0_.blockId as col_0_0_, formxpaths1_.xPath as col_1_0_, formxpaths1_.label as col_2_0_, formxpaths1_.formXpathScoreId as col_3_0_, case when ?='all' then case when formxpaths1_.xPath not in (? , ? , ? , ?) then CONVERT(float, count(case when facilitysc0_.score='???' then 1 end))/CONVERT(float, count(case when facilitysc0_.score='???' or facilitysc0_.score='????' or facilitysc0_.score='???? ????' or facilitysc0_.score='' then 1 end))*100 else CONVERT(FLOAT, count(case when facilitysc0_.score='???' then 1 end))/CONVERT(FLOAT, count(case when facilitysc0_.score='???' or facilitysc0_.score='????' then 1 end))*100 end else CONVERT(FLOAT, count(case when facilitysc0_.score='???' then 1 end))/CONVERT(FLOAT, count(case when facilitysc0_.score='???' or facilitysc0_.score='????' then 1 end))*100 end as col_4_0_, case when ?='all' then count(case when facilitysc0_.score='???' or facilitysc0_.score='????' or facilitysc0_.score='???? ????' or facilitysc0_.score='' then 1 end) else count(case when facilitysc0_.score='???' or facilitysc0_.score='????' then 1 end) end as col_5_0_, count(case when facilitysc0_.score='???' then 1 end) as col_6_0_ from FacilityScore facilitysc0_ inner join FormXpathScoreMapping formxpaths1_ on facilitysc0_.formXpathScoreId=formxpaths1_.formXpathScoreId inner join LastVisitData lastvisitd2_ on facilitysc0_.lastVisitDataId=lastvisitd2_.LastVisitDataId where formxpaths1_.formId=? and (formxpaths1_.type like 'select_one yes_no%') and ((facilitysc0_.score in (? , ?)) and (formxpaths1_.xPath in (? , ? , ? , ?)) or (facilitysc0_.score in (? , ? , ? , ?)) and (formxpaths1_.xPath not in (? , ? , ? , ?)) and ?='all' or facilitysc0_.score in (? , ?)) and (lastvisitd2_.DateOfVisit between ? and ?) and lastvisitd2_.IsLive=1 group by facilitysc0_.blockId , formxpaths1_.xPath , formxpaths1_.label , formxpaths1_.formXpathScoreId
Please help.
Solution
Try to change your JDBC URL to
value="${jdbc.url};databaseName=${jdbc.databaseName};useUnicode=yes;characterEncoding=UTF-8"
Note the useUnicode=yes
Answered By - Ram
Answer Checked By - Mary Flores (JavaFixing Volunteer)