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.

How to join unrelated entities with the JPA Criteria API

Two database tables have a foreign key relationship. They are mapped to two entities A and B by JPA, but …

java jpa join associations criteria-api
How to fetch all data in one query

I have multiple entities that are queried via JPA2 Criteria Query. I am able to join two of these entities …

java mysql hibernate jpa-2.0 criteria-api
Building a query using NOT EXISTS in jpa criteria api

I have two tables named as table1 ,table2.Both the tables are having same no of fields.There is no …

jpa jpa-2.0 criteria-api
JPA criteria API - Matching against a list in Spring Data JPA Specifications

i'm want to create a specification that matches a group id of a user object against a list of ids. …

jpa criteria-api spring-data
Distinct results from Spring Data JPA Specification that uses join

I have the following Specification that I use to query for any Contact entities that are tied to certain ManagedApplication …

java hibernate jpa spring-data-jpa criteria-api
"Not in" constraint using JPA criteria

I am trying to write a NOT IN constraint using JPA Criteria. I've tried something like this: builder.not(builder.…

java jpa jpa-2.0 criteria-api
How to do a distinct count in JPA critera API?

I would like to do this but with the criteria API instead: select count(distinct e) from Event e, IN(…

java hibernate jpa criteria-api
JPA Named Queries vs Criteria API?

Is there a heuristic/best practice/ruleset for a decision between the Criteria API and NamedQuery? My thoughts so far : …

java jpa criteria-api named-query
JPA/Hibernate Static Metamodel Attributes not Populated -- NullPointerException

I would like to use JPA2 Criteria API with metamodel objects, which seems to be pretty easy: ... Root<JPAAlbum&…

java hibernate nullpointerexception jpa-2.0 criteria-api
Select MAX timestamp with JPA2 Criteria API

So my entity has: @Column(name="TS", nullable=false) private java.sql.Timestamp timestamp; My generated MetaModel has: public static …

java generics jpa-2.0 java-ee-6 criteria-api