How to build CriteriaQuery from Sql Query in Hibernate JPA?

Solution Verified - Updated -

Issue

  • Whether it's possible to convert Sql Query to CriteriaQuery in hibernate JPA .

    Sql Query:

    select * from student where id>=2 and  id<=17
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x
  • Hibernate ORM
    • 5.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content