Home » Search

About CriteriaQuery

21-30 of 85Refresh
Manual
50

SELECT clause (JPQL / Criteria API)

.currency FROM Country c can be built as a criteria query as follows: CriteriaQuery q ... .capital.name FROM Country c can be defined using the criteria API as follows: CriteriaQuery ... to Object[]: CriteriaQuery q = cb.createTupleQuery(); Root c = q.from(Country
Manual
40

FROM clause (JPQL / Criteria API)

(and its sub interfaces). Criteria Query Roots The CriteriaQuery's from method serves as a factory of Root ... the following code: CriteriaQuery q = cb.createQuery(Country.class); Root c1 = q.from ... other CriteriaQuery methods - invocation of the from method does not override a previous invocation
Manual
31

WHERE clause (JPQL / Criteria API)

Queries The CriteriaQuery interface provides two where methods for setting the WHERE clause. Single ... as follows: CriteriaQuery q = cb.createQuery(Country.class); Root c = q.from ... : CriteriaQuery q = cb.createQuery(Country.class); Root c = q.from(Country.class); q
Manual
25

GROUP BY and HAVING clauses

become inaccessible. GROUP BY and HAVING in Criteria Queries The CriteriaQuery interface provides methods ... HAVING COUNT(c) > 1 can be built using the criteria query API as follows: CriteriaQuery
Manual
25

ORDER BY clause (JPQL / Criteria API)

the result order would be undefined. ORDER BY in Criteria Queries The CriteriaQuery interface ... follows: CriteriaQuery q = cb.createQuery(Country.class); Root c = q.from
Forum
24

CriteriaQuery .where() for multiple conditions

When using the below, there appears to be an OR condition:   criteriaQuery.where(criteriaBuilder.equal(root.get("name"), name)); criteriaQuery.where(criteriaBuilder.equal(root.get("surname ... (); CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Person.class); Root
Forum
23

"Unexpected query expression" using CriteriaQuery FetchParent Interface

.getCriteriaBuilder();   CriteriaQuery criteriaQuery = cb.createQuery(Person.class);   Root root = criteriaQuery.from(Person.class);   root.fetch("PersonData"); //@OneToOne relationship   criteriaQuery.select(root);   System.out.println(em.createQuery(criteriaQuery).getResultList
Forum
22

JPA CriteriaQuery -- Iterate Expression<List<Object>>

Hi, I am new to  JPA and in particular the CriteriaQuery API. I have a simple CriteriaQuery where I pattern match a simple search String against field entires in a Person entity... i.e ... "); criteriaQuery.where( builder.or( builder.like( root.get("name
Forum
21

CriteriaQuery using isNotNull with other conditions results in InternalException

When I try to execute the following criteria query CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery criteria = builder.createQuery(relationshipClass); Root root = criteria.from(relationshipClass); criteria.select(root); List
JPA Doc
16

javax.persistence.criteria.CriteriaBuilder

Since: JPA 2.0 CriteriaQuery createQuery() Create a CriteriaQuery object. Create a CriteriaQuery object. Returns: criteria query object Since: JPA 2.0 CriteriaQuery createQuery(Class resultClass) Create a CriteriaQuery object with the specified result type. Create a CriteriaQuery object