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;








0















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!










share|improve this question



















  • 2





    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

















0















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!










share|improve this question



















  • 2





    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













0












0








0


0






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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 14:55









nsandersen

3521921




3521921










asked Mar 23 at 20:46









mohamed hassanmohamed hassan

1




1







  • 2





    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












  • 2





    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







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












1 Answer
1






active

oldest

votes


















0














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






share|improve this answer























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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






    share|improve this answer



























      0














      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






      share|improve this answer

























        0












        0








        0







        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






        share|improve this answer













        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 7:27









        AlienAlien

        5,75331229




        5,75331229





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript