ObjectDB Database Search

1-50 of 87 results

SELECT clause (JPQL / Criteria API)

FROM Country c can be built as a criteria query as follows: CriteriaQuery q = cb. createQuery (Country ... .capital.name FROM Country c can be defined using the criteria API as follows: CriteriaQuery q = cb ... ]); } CriteriaBuilder's tuple The Tuple interface can be used as a clean alternative to Object[] : CriteriaQuery q

FROM clause (JPQL / Criteria API)

(and its sub interfaces). Criteria Query Roots The CriteriaQuery 's from method serves as a factory ... the following code: CriteriaQuery q = cb. createQuery (Country.class); Root c1 = q. from (Country.class); Root c2 = q. from (Country.class); q. multiselect (c1, c2); Unlike other CriteriaQuery methods

JPA Criteria API Queries

: CriteriaBuilder cb = em. getCriteriaBuilder (); CriteriaQuery q = cb. createQuery (Country.class ... (both methods are equivalent). In the example above a  CriteriaQuery instance is created ... expression. CriteriaQuery TypedQuery TypedQuery TypedQuery query = em. createQuery (q); List results

InterfaceRef jakarta.persistence.criteria.CriteriaQuery

JPA Interface CriteriaQuery Type Parameters: - the type of the defined result Super Interfaces: AbstractQuery , CommonAbstractCriteria , CriteriaSelect The CriteriaQuery interface defines ... explains how to use CriteriaQuery . Public Methods CriteriaQuery distinct (boolean distinct) Specify

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 root = criteriaQuery

CriteriaQuery.multiselect(selectionList) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery multiselect (    ... : If the type of the criteria query is CriteriaQuery (i.e., a criteria query object created by ... of the criteria query is CriteriaQuery for some user-defined class X (i.e., a criteria query object

CriteriaQuery.multiselect(selections) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery multiselect (    ... of the criteria query is CriteriaQuery (i.e., a criteria query object created by ... is CriteriaQuery for some user-defined class X (i.e., a criteria query object created by passing a X class

"Unexpected query expression" using CriteriaQuery FetchParent Interface

; 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()); } }   Exception in

CriteriaQuery.select(selection) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery select (    ... type is specified. For example: CriteriaQuery q = cb.createQuery(String.class); Root order = q.from ... ;)); CriteriaQuery q2 = cb.createQuery(Product.class); q2.select(q2.from(Order.class) .join("items") . join

JPA CriteriaQuery -- Iterate Expression>

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 ... record.FIELD LIKE searchString) Path status = root.get("status"); criteriaQuery .where( builder.or

EntityManager.createQuery(criteriaQuery) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createQuery (    CriteriaQuery   criteriaQuery ) Create an instance of TypedQuery for executing a criteria query. Parameters: criteriaQuery - a criteria query object Return: the new query instance Throws

CriteriaQuery.groupBy(grouping) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery groupBy (    Expression ... grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions

CriteriaQuery.groupBy(grouping) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery groupBy (   List  grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified

CriteriaQuery.where(restrictions) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery where (   Predicate... restrictions ) Modify the query to restrict the query result according to the conjunction of the specified restriction predicates. Replaces the previously added restriction(s), if any

CriteriaQuery.having(restrictions) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery having (   List  restrictions ) Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. Replaces the previously added having restriction(s), if any

CriteriaQuery.where(restrictions) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery where (   List  restrictions ) Modify the query to restrict the query result according to the conjunction of the specified restriction predicates. Replaces the previously added restriction(s), if any

CriteriaQuery.distinct(distinct) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery distinct (   boolean distinct ) Specify whether duplicate query results are eliminated. A true value will cause duplicates to be eliminated. A false value will cause duplicates to be retained. If distinct has not

CriteriaQuery.orderBy(o) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery orderBy (   List  o ) Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous ordering

CriteriaQuery.having(restrictions) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery having (   Predicate... restrictions ) Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. Replaces the previously added having restriction(s

CriteriaQuery.orderBy(o) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery orderBy (   Order... o ) Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous

CriteriaQuery.where(restriction) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery where (    Expression  restriction ) Modify the query to restrict the query result according to the specified boolean expression. Replaces the previously added restriction(s), if any. This method only overrides

CriteriaQuery.having(restriction) - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery CriteriaQuery having (    Expression  restriction ) Specify a restriction over the groups of the query. Replaces the previous having restriction(s), if any. This method only overrides the return type of the corresponding

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 predicates = new ArrayList (); predicates.add(builder

CriteriaQuery.getOrderList() - JPA Method

JPA Method in jakarta.persistence.criteria. CriteriaQuery List getOrderList () Return the ordering expressions in order of precedence. Returns empty list if no ordering expressions have been specified. Modifications to the list do not affect the query. Return: the list of ordering expressions Since: JPA 2.0

CriteriaQuery.getParameters() - JPA Method

JPA Method in javax.persistence.criteria. CriteriaQuery Set getParameters () Return the parameters of the query. Returns empty set if there are no parameters. Modifications to the set do not affect the query. Return: the query parameters Since: JPA 2.0

JPA Queries

; CriteriaQuery interface: As noted above, eventually every criteria query is managed by an ordinary TypedQuery instance. The CriteriaQuery instance merely represents the query during its building

WHERE clause (JPQL / Criteria API)

but they are especially dominant in the WHERE clause. WHERE in Criteria Queries The CriteriaQuery interface provides ... can be built by using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country.class

GROUP BY and HAVING clauses

and HAVING in Criteria Queries The CriteriaQuery interface provides methods for setting the GROUP BY ... using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country.class); Root c = q

ORDER BY clause (JPQL / Criteria API)

Criteria Queries The CriteriaQuery interface provides methods for setting the ORDER BY clause ... can be built using the criteria query API as follows: CriteriaQuery q = cb. createQuery (Country.class

InterfaceRef jakarta.persistence.criteria.CriteriaBuilder

.1 CriteriaQuery createQuery () Create a CriteriaQuery object. Return: criteria query object Since: JPA 2.0 CriteriaQuery createQuery (Class  resultClass) Create a CriteriaQuery object ... Since: JPA 2.0 CriteriaQuery createTupleQuery () Create a CriteriaQuery object that returns a tuple

InterfaceRef jakarta.persistence.EntityManager

LockOption s. See Also: Query TypedQuery CriteriaQuery PersistenceContext StoredProcedureQuery ... - if the delete query is found to be invalid Since: JPA 2.1 TypedQuery createQuery ( CriteriaQuery   criteriaQuery ) Create an instance of TypedQuery for executing a criteria query. Parameters: criteriaQuery

InterfaceRef jakarta.persistence.criteria.Subquery

. This may be a CriteriaQuery , CriteriaUpdate, CriteriaDelete, or a Subquery. Return: the enclosing query or subquery ... the query of which this is a subquery. This must be a CriteriaQuery or a Subquery. Return ... for the CriteriaQuery or Subquery itself, including any subquery roots defined as a result of correlation. Returns

Path.get(attributeName) - JPA Method

variables. For example: CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class ... ;))); } rather than: {@snippet : CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); Path

InterfaceRef jakarta.persistence.Query

language SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery } query Since: JPA 2.0 int ... . CriteriaQuery } query Since: JPA 2.0 Query setMaxResults (int maxResult) Set the maximum number of results

InterfaceRef jakarta.persistence.TypedQuery

SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery } query Inherited from: Query ... . CriteriaQuery } query Since: JPA 2.0 TypedQuery setMaxResults (int maxResult) Set the maximum

InterfaceRef jakarta.persistence.criteria.From

. For example: CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); q.select(p ... : CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); Path nicknames = p.get("

InterfaceRef jakarta.persistence.StoredProcedureQuery

.persistence.criteria. CriteriaQuery } query Inherited from: Query Since: JPA 2.0 int getMaxResults ... to be a Jakarta Persistence query language SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery

InterfaceRef jakarta.persistence.criteria.Path

: CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); q.select(p) .where(cb.isMember("joe", p. get("nicknames"))); } rather than: {@snippet : CriteriaQuery q

CriteriaBuilder.createTupleQuery() - JPA Method

JPA Method in jakarta.persistence.criteria.CriteriaBuilder CriteriaQuery createTupleQuery () Create a CriteriaQuery object that returns a tuple of objects as its result. Return: criteria query object Since: JPA 2.0

CriteriaBuilder.createQuery(resultClass) - JPA Method

JPA Method in jakarta.persistence.criteria.CriteriaBuilder CriteriaQuery createQuery (   Class  resultClass ) Create a CriteriaQuery object with the given result type. Parameters: resultClass - type of the query result Return: criteria query object Since: JPA 2.0

CriteriaBuilder.createQuery() - JPA Method

JPA Method in jakarta.persistence.criteria.CriteriaBuilder CriteriaQuery createQuery () Create a CriteriaQuery object. Return: criteria query object Since: JPA 2.0

EntityManagerFactory.getCriteriaBuilder() - JPA Method

JPA Method in jakarta.persistence.EntityManagerFactory CriteriaBuilder getCriteriaBuilder () Return an instance of CriteriaBuilder which may be used to construct jakarta.persistence.criteria. CriteriaQuery objects. Return: an instance of {@link CriteriaBuilder} Throws: IllegalStateException

InterfaceRef jakarta.persistence.EntityManagerFactory

. CriteriaQuery objects. Return: an instance of {@link CriteriaBuilder} Throws: IllegalStateException

Query.setLockMode(lockMode) - JPA Method

to be a Jakarta Persistence query language SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery } query Since: JPA 2.0

Subquery.getContainingQuery() - JPA Method

JPA Method in jakarta.persistence.criteria.Subquery CommonAbstractCriteria getContainingQuery () Return the query of which this is a subquery. This may be a CriteriaQuery , CriteriaUpdate, CriteriaDelete, or a Subquery. Return: the enclosing query or subquery Since: JPA 2.1

Subquery.getParent() - JPA Method

JPA Method in jakarta.persistence.criteria.Subquery AbstractQuery getParent () Return the query of which this is a subquery. This must be a CriteriaQuery or a Subquery. Return: the enclosing query or subquery Since: JPA 2.0

Query.getLockMode() - JPA Method

SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery } query Since: JPA 2.0

AbstractQuery.getRoots() - JPA Method

JPA Method in jakarta.persistence.criteria.AbstractQuery Set getRoots () Return the query roots. These are the roots that are defined for the CriteriaQuery or Subquery itself, including any subquery roots defined as a result of correlation. Returns an empty set if no roots have been defined

InterfaceRef jakarta.persistence.criteria.AbstractQuery

that are defined for the CriteriaQuery or Subquery itself, including any subquery roots defined as a result

TypedQuery.setLockMode(lockMode) - JPA Method

to be a Jakarta Persistence query language SELECT query or a {@link jakarta.persistence.criteria. CriteriaQuery } query Since: JPA 2.0