How to solve Arabic value problem in Hibernate querySave Data in Arabic in MySQL databaseWhat are the possible values of the Hibernate hbm2ddl.auto configuration and what do they doUnicode String in Hibernate QueriesHow to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?Hibernate: How to set NULL query-parameter value with HQL?problem in date column with hibernate hql queryHow to solve the “failed to lazily initialize a collection of role” Hibernate exceptionHibernate Query Like IssueWhile running Hibernate Criteria, HQL query is not created in given orderMySQL - Hibernate SQL Query
How many wires should be in a new thermostat cable?
Computing elements of a 1000 x 60 matrix exhausts RAM
Caught with my phone during an exam
How does the Earth's center produce heat?
Wifi light switch needs neutral wire. Why? AND Can that wire be a skinny one?
amsmath: How can I use the equation numbering and label manually and anywhere?
Why the work done is positive when bringing 2 opposite charges together?
What is the required burn to keep a satellite at a Lagrangian point?
mmap: effect of other processes writing to a file previously mapped read-only
Is it safe to redirect stdout and stderr to the same file without file descriptor copies?
How to make Flex Markers appear in Logic Pro X?
Negative impact of having the launch pad away from the Equator
Ribbon Cable Cross Talk - Is there a fix after the fact?
Adobe Illustrator: How can I change the profile of a dashed stroke?
Surface of the 3x3x3 cube as a graph
(For training purposes) Are there any openings with rook pawns that are more effective than others (and if so, what are they)?
A nasty indefinite integral
Can a UK national work as a paid shop assistant in the USA?
Is a world with one country feeding everyone possible?
Way of refund if scammed?
What does it mean for something to be strictly less than epsilon for an arbitrary epsilon?
Why "strap-on" boosters, and how do other people say it?
What happens when redirecting with 3>&1 1>/dev/null?
Writing "hahaha" versus describing the laugh
How to solve Arabic value problem in Hibernate query
Save Data in Arabic in MySQL databaseWhat are the possible values of the Hibernate hbm2ddl.auto configuration and what do they doUnicode String in Hibernate QueriesHow to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?Hibernate: How to set NULL query-parameter value with HQL?problem in date column with hibernate hql queryHow to solve the “failed to lazily initialize a collection of role” Hibernate exceptionHibernate Query Like IssueWhile running Hibernate Criteria, HQL query is not created in given orderMySQL - Hibernate SQL Query
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
When I use an Arabic value in an HQL query, it returns null.
I added the unicode and UTF in MySQL datasource.
I got SQL generated from the Hibernate query and ran it in workbench, and it gave me a result:
Query q = se.createQuery("from Days where d_name = 'الخميس' " );
I run the generated SQL query on workbench and it gives me a result. I also tried to query with d_id and it runs without problems, so i think that the problem is with Arabic values.
I expect the result to come back as an object,
but it returns null!
java hibernate spring-mvc
add a comment |
When I use an Arabic value in an HQL query, it returns null.
I added the unicode and UTF in MySQL datasource.
I got SQL generated from the Hibernate query and ran it in workbench, and it gave me a result:
Query q = se.createQuery("from Days where d_name = 'الخميس' " );
I run the generated SQL query on workbench and it gives me a result. I also tried to query with d_id and it runs without problems, so i think that the problem is with Arabic values.
I expect the result to come back as an object,
but it returns null!
java hibernate spring-mvc
2
AddN
befor arabic value, tryse.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16
add a comment |
When I use an Arabic value in an HQL query, it returns null.
I added the unicode and UTF in MySQL datasource.
I got SQL generated from the Hibernate query and ran it in workbench, and it gave me a result:
Query q = se.createQuery("from Days where d_name = 'الخميس' " );
I run the generated SQL query on workbench and it gives me a result. I also tried to query with d_id and it runs without problems, so i think that the problem is with Arabic values.
I expect the result to come back as an object,
but it returns null!
java hibernate spring-mvc
When I use an Arabic value in an HQL query, it returns null.
I added the unicode and UTF in MySQL datasource.
I got SQL generated from the Hibernate query and ran it in workbench, and it gave me a result:
Query q = se.createQuery("from Days where d_name = 'الخميس' " );
I run the generated SQL query on workbench and it gives me a result. I also tried to query with d_id and it runs without problems, so i think that the problem is with Arabic values.
I expect the result to come back as an object,
but it returns null!
java hibernate spring-mvc
java hibernate spring-mvc
edited Mar 24 at 14:55
nsandersen
3521921
3521921
asked Mar 23 at 20:46
mohamed hassanmohamed hassan
1
1
2
AddN
befor arabic value, tryse.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16
add a comment |
2
AddN
befor arabic value, tryse.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16
2
2
Add
N
befor arabic value, try se.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Add
N
befor arabic value, try se.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16
add a comment |
1 Answer
1
active
oldest
votes
Although Adding N
before arabic values might solve you problem but Prefixing all values with N can cause horrific performance issues - often, this will cause queries to result in full table scans rather than index lookups.
You can find out a way by using utf-8 as suggested here
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318205%2fhow-to-solve-arabic-value-problem-in-hibernate-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Although Adding N
before arabic values might solve you problem but Prefixing all values with N can cause horrific performance issues - often, this will cause queries to result in full table scans rather than index lookups.
You can find out a way by using utf-8 as suggested here
add a comment |
Although Adding N
before arabic values might solve you problem but Prefixing all values with N can cause horrific performance issues - often, this will cause queries to result in full table scans rather than index lookups.
You can find out a way by using utf-8 as suggested here
add a comment |
Although Adding N
before arabic values might solve you problem but Prefixing all values with N can cause horrific performance issues - often, this will cause queries to result in full table scans rather than index lookups.
You can find out a way by using utf-8 as suggested here
Although Adding N
before arabic values might solve you problem but Prefixing all values with N can cause horrific performance issues - often, this will cause queries to result in full table scans rather than index lookups.
You can find out a way by using utf-8 as suggested here
answered Mar 24 at 7:27
AlienAlien
5,75331229
5,75331229
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318205%2fhow-to-solve-arabic-value-problem-in-hibernate-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Add
N
befor arabic value, tryse.createQuery("from Days where d_name = N'الخميس' " );
– ElasticCode
Mar 23 at 21:09
Pleas confirm which database you are using - if it’s a syntax thing, we need to know to help you
– Bohemian♦
Mar 23 at 21:16