Hibernate + Wildcard search for data types like date/integer using criteria queryHibernate Criteria, Integer and “like”How to query on a month for a date with Hibernate criteriaCreate the perfect JPA entityConverting a Hibernate Criteria Query to JPA 2 Criteria QueryWhat's the difference between JPA and Hibernate?Hibernate Criteria equivalent to the SQL queryIssue in Hibernate Criteria QueryHibernate Criteria. Restrictions and max Datehibernate hql like criteria on date type fieldWhy Hibernate inlines Integer parameter list passed to JPA Criteria Query?

Could one become a successful researcher by writing some really good papers while being outside academia?

What does "sardine box" mean?

Acceptable to cut steak before searing?

How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?

Does two puncture wounds mean venomous snake?

Does this Foo machine halt?

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

Ex-contractor published company source code and secrets online

Are any jet engines used in combat aircraft water cooled?

Why couldn't soldiers sight their own weapons without officers' orders?

If a Contingency spell has been cast on a creature, does the Simulacrum spell transfer the contingent spell to its duplicate?

Visa National - No Exit Stamp From France on Return to the UK

How does The Fools Guild make its money?

A stranger from Norway wants to have money delivered to me

Was this a rapid SCHEDULED disassembly? How was it done?

Looking for a new job because of relocation - is it okay to tell the real reason?

Generator for parity?

How can a surrogate pass on genes to a fertilized embryo?

Does a code snippet compile? Or does it get compiled?

Why did Gandalf use a sword against the Balrog?

Optimal way to extract "positive part" of a multivariate polynomial

Can I legally make a real mobile app based on a fictional app from a TV show?

Best gun to modify into a monsterhunter weapon?

Y2K... in 2019?



Hibernate + Wildcard search for data types like date/integer using criteria query


Hibernate Criteria, Integer and “like”How to query on a month for a date with Hibernate criteriaCreate the perfect JPA entityConverting a Hibernate Criteria Query to JPA 2 Criteria QueryWhat's the difference between JPA and Hibernate?Hibernate Criteria equivalent to the SQL queryIssue in Hibernate Criteria QueryHibernate Criteria. Restrictions and max Datehibernate hql like criteria on date type fieldWhy Hibernate inlines Integer parameter list passed to JPA Criteria Query?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















How to use wildcard search for column which has date/integer as data type in DB using criteria query in hibernate.



I am using hibernate version 4.3



Note : I need one single ORM query which should support both DB like Oracle as well as SQL.



I was able to do wildcard search specific to DB but that was not the generic solution so what I have done is for SQL I have used SQL Restriction with CONVERT and REPLACE FUNCTION and that works for me and for ORACLE I have used to_Date function to get appropriate results.



Is there any generic way in ORM by which I can get the results in single query without relying on some DB specific query to use wildcard search using LIKE for a data types like date or an integer ?










share|improve this question
































    0















    How to use wildcard search for column which has date/integer as data type in DB using criteria query in hibernate.



    I am using hibernate version 4.3



    Note : I need one single ORM query which should support both DB like Oracle as well as SQL.



    I was able to do wildcard search specific to DB but that was not the generic solution so what I have done is for SQL I have used SQL Restriction with CONVERT and REPLACE FUNCTION and that works for me and for ORACLE I have used to_Date function to get appropriate results.



    Is there any generic way in ORM by which I can get the results in single query without relying on some DB specific query to use wildcard search using LIKE for a data types like date or an integer ?










    share|improve this question




























      0












      0








      0








      How to use wildcard search for column which has date/integer as data type in DB using criteria query in hibernate.



      I am using hibernate version 4.3



      Note : I need one single ORM query which should support both DB like Oracle as well as SQL.



      I was able to do wildcard search specific to DB but that was not the generic solution so what I have done is for SQL I have used SQL Restriction with CONVERT and REPLACE FUNCTION and that works for me and for ORACLE I have used to_Date function to get appropriate results.



      Is there any generic way in ORM by which I can get the results in single query without relying on some DB specific query to use wildcard search using LIKE for a data types like date or an integer ?










      share|improve this question
















      How to use wildcard search for column which has date/integer as data type in DB using criteria query in hibernate.



      I am using hibernate version 4.3



      Note : I need one single ORM query which should support both DB like Oracle as well as SQL.



      I was able to do wildcard search specific to DB but that was not the generic solution so what I have done is for SQL I have used SQL Restriction with CONVERT and REPLACE FUNCTION and that works for me and for ORACLE I have used to_Date function to get appropriate results.



      Is there any generic way in ORM by which I can get the results in single query without relying on some DB specific query to use wildcard search using LIKE for a data types like date or an integer ?







      hibernate jpa






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 9:50







      Abhinay Honrao

















      asked Mar 27 at 7:42









      Abhinay HonraoAbhinay Honrao

      13 bronze badges




      13 bronze badges

























          0






          active

          oldest

          votes










          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%2f55372056%2fhibernate-wildcard-search-for-data-types-like-date-integer-using-criteria-quer%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          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%2f55372056%2fhibernate-wildcard-search-for-data-types-like-date-integer-using-criteria-quer%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