Top "Criteria-api" questions

This tag is for questions related to the Java Persistence Criteria API (from JPA 2.0) which is used to define queries through the construction of object-based query definition objects, rather than use of the string-based approach of the Java Persistence query language.

JPA Criteria Query API and order by two columns

I'm stuck with a simple problem; struggling how to invoke order by on a joined entity. Essentially I am trying …

java jpa sql-order-by criteria-api
How to use JPA Criteria API when joining many tables

This is the further question to this: How to use JPA Criteria API in JOIN CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder(); CriteriaQuery&…

java jpa join criteria-api
JPA Criteria Query distinct

I am trying to write a distinct criteria query, using: CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery<RuleVar> query = builder.…

java jpa criteria-api
JPA Criteria API IN expression Parameter list

Is there a possibility to use a parameter list in Criteria API .in expression? I have something like this: List&…

java jpa expression criteria-api
Correct usage of JPA criteria API, Predicates and where method of CriteriaQuery

I am trying to test a JPA repository. Here is my client/test code: @Test public void testFindBoitesByMultiFieldWithIdentifiantSet() { BoiteDataOnDemand dod = …

hibernate jpa jpa-2.0 criteria-api
Using the JPA Criteria API, can you do a fetch join that results in only one join?

Using JPA 2.0. It seems that by default (no explicit fetch), @OneToOne(fetch = FetchType.EAGER) fields are fetched in 1 + N queries, …

java jpa jpql criteria-api
Criteria JPA 2 with 3 tables

I'm trying to create a criteria to retrieve some objects from 3 tables (Associate, Update and Detail). A Detail has reference …

java jpa-2.0 jpql criteria-api
How to make a CriteriaBuilder join with a custom "on" condition?

I want make a query where I join 2 tables, using the CriteriaBuilder. In MySQL the query I'm trying to make …

jpa jpa-2.0 criteria-api
Spring Data JPA: Creating Specification Query Fetch Joins

TL;DR: How do you replicate JPQL Join-Fetch operations using specifications in Spring Data JPA? I am trying to build …

java spring jpa spring-data-jpa criteria-api
JPA - Criteria API and EmbeddedId

I want to use criteria to make the following query. I have an Entity with EmbeddedId defined: @Entity @Table(name="…

jpa jpa-2.0 criteria-api composite-id