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

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현