Skip to content

Migrate from Hibernate Criteria to JPA Criteria #14612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
graemerocher opened this issue May 9, 2017 · 2 comments
Open

Migrate from Hibernate Criteria to JPA Criteria #14612

graemerocher opened this issue May 9, 2017 · 2 comments

Comments

@graemerocher
Copy link
Contributor

The Hibernate Criteria API has been deprecated in Hibernate. So we have to move to the JPA Criteria API in GORM.

This may be a good time to deprecate CriteriaBuilder and friends, recommending instead to use where queries and DetachedCriteria

@nitin-j9
Copy link

Hi All, In my project we have extensively used hibernate criteria, which has now deprecated in newer releases. I tried to replace the same with the JPA criteria but faced some below mentioned issues:

  1. Select query will be involved for every sub-entities defined in the parent entity class.
  2. Correct joins are not in place, since in hibernate criteria we define everything in an entity class. By using fetch and join method we explicitly needs to define the entities till it's depth.
  3. Using graph we can define the depth of entities in the parent entity class.

My question is when we already define in the entity class then why we needs to do these all extra things.

Please suggest the best solution on this, I didn't found any proper solution on this.

Regards,
Nitin Jain

@jdaugherty jdaugherty transferred this issue from apache/grails-data-mapping Apr 22, 2025
@borinquenkid
Copy link

I have been working on Grails Hibernate 6. The README is pretty up to date on progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants