2

Is there Hibernate criteria like queries in JPA?

2 Answers 2

4

As said above it exists but i don't really like it. You should read that blog article which tell you how to use JPA Criteria with Spring-Data or Querydsl: http://blog.springsource.org/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/

Sign up to request clarification or add additional context in comments.

2 Comments

I agree. Criteria queries is one of the JPA 2 features I don't use. At least not directly.
So true. The criteria api from jpa is not well designed. the article about the specification pattern shows better ways of implementing type safe queries. I wonder why this is not something the "expert group" could come up with...#
3

JPA 2.0 has it. Refer [1] from OpenJPA.

[1] http://openjpa.apache.org/builds/latest/docs/manual/jpa_overview_criteria.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.