ObjectDB Database Search
1-50 of 200 resultsFROM clause (JPQL / Criteria API) The FROM clause declares query identification variables for iterating over objects in the database ... (you can use type expression to exclude descendant classes from iteration). For example, in the following query, c iterates over all the Country objects in the database: SELECT c FROM Country AS c | |
JPA Criteria FROM and JOIN The Jakarta Persistence Criteria API uses a specific set of interfaces to construct the FROM ... , to manage data navigation and retrieval optimization. The interface hierarchy for the FROM clause is structured as follows: Criteria Query From Components in Jakarta Persistence (JPA) 3.2  | |
jakarta.persistence.criteria.From Jakarta Persistence (JPA) Interface jakarta.persistence.criteria. From Type Parameters ... , TupleElement Represents a bound type, usually an entity that appears in the from clause, but may also be an embeddable belonging to an entity in the from clause. Serves as a factory for Join s of associations | |
jakarta.persistence.criteria.From.getCorrelationParent() Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From From getCorrelationParent() Returns the parent From object from which the correlated From object has been obtained through correlation (use of Subquery.correlate method). Returns: the parent of the correlated From object. Throws | |
jakarta.persistence.criteria.From.getJoins() Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Set getJoins() Return the joins that have been made from this bound type. Returns empty set if no joins have been made from this bound type. Modifications to the set do not affect the query. Returns: joins made from this type. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.isCorrelated() Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From boolean isCorrelated() Whether the From object has been obtained as a result of correlation (use of a Subquery.correlate method). Returns: boolean indicating whether the object has been obtained through correlation. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.AbstractQuery.from(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.AbstractQuery Root from ( Class entityClass ) Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots. Parameters: entityClass - the entity class Returns: query | |
jakarta.persistence.criteria.AbstractQuery.from(EntityType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.AbstractQuery Root from ( EntityType entity ) Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots. Parameters: entity - metamodel entity representing | |
jakarta.persistence.criteria.From.joinMap(String,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From MapJoin joinMap ( String attributeName , JoinType jt ) Create a join to the specified Map -valued attribute using the given join type. Parameters: attributeName - name of the attribute for the target | |
jakarta.persistence.criteria.From.join(EntityType,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( EntityType entity , JoinType joinType ) Create and add a join to the given entity. Parameters: entity - metamodel entity representing the join target joinType - join type Returns: the resulting join. Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.criteria.From.join(SingularAttribute) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( SingularAttribute attribute ) Create an inner join to the specified single-valued attribute. Parameters: attribute - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(SingularAttribute,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( SingularAttribute attribute , JoinType jt ) Create a join to the specified single-valued attribute using the given join type. Parameters: jt - join type attribute - target of the join | |
jakarta.persistence.criteria.From.join(CollectionAttribute) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From CollectionJoin join ( CollectionAttribute collection ) Create an inner join to the specified Collection -valued attribute. Parameters: collection - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( Class entityClass ) Create and add an inner join to the given entity. Parameters: entityClass - the target entity class Returns: the resulting join. Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.criteria.From.join(Class,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( Class entityClass , JoinType joinType ) Create and add a join to the given entity. Parameters: entityClass - the target entity class joinType - join type Returns: the resulting join. Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.criteria.From.join(EntityType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( EntityType entity ) Create and add an inner join to the given entity. Parameters: entity - metamodel entity representing the join target Returns: the resulting join. Since: Jakarta Persistence (JPA) 3.2 | |
jakarta.persistence.criteria.From.join(SetAttribute,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From SetJoin join ( SetAttribute set , JoinType jt ) Create a join to the specified Set -valued attribute using the given join type. Parameters: jt - join type set - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(ListAttribute,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From ListJoin join ( ListAttribute list , JoinType jt ) Create a join to the specified List -valued attribute using the given join type. Parameters: jt - join type list - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(MapAttribute,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From MapJoin join ( MapAttribute map , JoinType jt ) Create a join to the specified Map -valued attribute using the given join type. Parameters: jt - join type map - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(String) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( String attributeName ) Create an inner join to the specified attribute. Parameters: attributeName - name of the attribute for the target of the join Returns: the resulting join. Throws | |
jakarta.persistence.criteria.From.join(SetAttribute) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From SetJoin join ( SetAttribute set ) Create an inner join to the specified Set -valued attribute. Parameters: set - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(ListAttribute) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From ListJoin join ( ListAttribute list ) Create an inner join to the specified List -valued attribute. Parameters: list - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(MapAttribute) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From MapJoin join ( MapAttribute map ) Create an inner join to the specified Map -valued attribute. Parameters: map - target of the join Returns: the resulting join. Since: Jakarta Persistence (JPA) 1.0 | |
jakarta.persistence.criteria.From.join(CollectionAttribute,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From CollectionJoin join ( CollectionAttribute collection , JoinType jt ) Create a join to the specified Collection -valued attribute using the given join type. Parameters: jt - join type collection - target | |
jakarta.persistence.criteria.From.join(String,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From Join join ( String attributeName , JoinType jt ) Create a join to the specified attribute using the given join type. Parameters: attributeName - name of the attribute for the target of the join jt | |
jakarta.persistence.criteria.From.joinCollection(String,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From CollectionJoin joinCollection ( String attributeName , JoinType jt ) Create a join to the specified Collection -valued attribute using the given join type. Parameters: attributeName - name | |
jakarta.persistence.criteria.From.joinSet(String,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From SetJoin joinSet ( String attributeName , JoinType jt ) Create a join to the specified Set -valued attribute using the given join type. Parameters: attributeName - name of the attribute for the target | |
jakarta.persistence.criteria.From.joinList(String,JoinType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From ListJoin joinList ( String attributeName , JoinType jt ) Create a join to the specified List -valued attribute using the given join type. Parameters: attributeName - name of the attribute for the target | |
jakarta.persistence.criteria.From.joinCollection(String) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From CollectionJoin joinCollection ( String attributeName ) Create an inner join to the specified Collection -valued attribute. Parameters: attributeName - name of the attribute for the target of the join Returns | |
jakarta.persistence.criteria.From.joinSet(String) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From SetJoin joinSet ( String attributeName ) Create an inner join to the specified Set -valued attribute. Parameters: attributeName - name of the attribute for the target of the join Returns: the resulting join. Throws | |
jakarta.persistence.criteria.From.joinList(String) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From ListJoin joinList ( String attributeName ) Create an inner join to the specified List -valued attribute. Parameters: attributeName - name of the attribute for the target of the join Returns: the resulting join | |
jakarta.persistence.criteria.From.joinMap(String) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. From MapJoin joinMap ( String attributeName ) Create an inner join to the specified Map -valued attribute. Parameters: attributeName - name of the attribute for the target of the join Returns: the resulting join. Throws | |
jakarta.persistence.criteria.CriteriaUpdate.from(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaUpdate Root from ( Class entityClass ) Create and add a query root corresponding to the entity that is the target of the update. A CriteriaUpdate object has a single root, the entity that is being updated | |
jakarta.persistence.criteria.CriteriaUpdate.from(EntityType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaUpdate Root from ( EntityType entity ) Create and add a query root corresponding to the entity that is the target of the update. A CriteriaUpdate object has a single root, the entity that is being updated | |
jakarta.persistence.criteria.CriteriaDelete.from(Class) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaDelete Root from ( Class entityClass ) Create and add a query root corresponding to the entity that is the target of the DELETE. A CriteriaDelete object has a single root, the entity that is being deleted | |
jakarta.persistence.criteria.CriteriaDelete.from(EntityType) Jakarta Persistence (JPA) Method in jakarta.persistence.criteria.CriteriaDelete Root from ( EntityType entity ) Create and add a query root corresponding to the entity that is the target of the DELETE. A CriteriaDelete object has a single root, the entity that is being deleted | |
SELECT clause (JPQL / Criteria API) query = em. createQuery ("SELECT c FROM Country c", Country.class); List results = query ... c.name FROM Country AS c Using path expressions , such as c.name , in query results is called projection. Projection extracts field values from entities to form the query results. The results | |
Retrieving JPA Entities Jakarta Persistence (JPA) provides various ways to retrieve objects from the database. Retrieving ... the persistence context, JPA constructs a new object and populates it with data from the database or ... retrieves the object's data from the database, constructs a new managed entity, and returns | |
Paths and Types in JPQL and Criteria API classes) are represented in JPQL by the following types of expressions: Variables : FROM ... as arguments. Path expressions that navigate from one object to another. Instances of user-defined ... that navigates from the Capital entity to its name field. A path expression can be extended | |
GROUP BY and HAVING clauses, the GROUP BY clause is processed after the FROM and WHERE clauses but before the SELECT clause. When a query includes a GROUP BY clause, the database objects (or tuples) that result from the FROM clause ... SUBSTRING(c.name, 1, 1) FROM Country c GROUP BY SUBSTRING(c.name, 1, 1); The FROM clause iterates | |
ORDER BY clause (JPQL / Criteria API), ordered by country name: SELECT c.name FROM Country c WHERE c.population 1000000 ORDER BY c.name If a query includes an ORDER BY clause, it is the last clause to be executed. The FROM clause first ... directly from expressions in the SELECT clause. For example, the following query is invalid | |
WHERE clause (JPQL / Criteria API) The WHERE clause adds filtering capabilities to the SELECT- FROM statement. It is essential for retrieving a specific subset of objects from the database. How a WHERE clause works The following query ... FROM Country c WHERE c.population :p The FROM clause of this query defines an iteration | |
Database Schema Evolution an intermediate class from the hierarchy. Convertible types When a matching field is found but its type is different from the type of the new field, a conversion is required. If the old type cannot be converted to the new type (for example, a change from int to Date ), the fields are not considered matching | |
JPA Query Structure (JPQL / Criteria), which returns only field values from database tables. This makes JPQL more object-oriented ... of up to six clauses in the following format: SELECT ... FROM ... [WHERE ...] [GROUP BY ... [HAVING ...]] [ORDER BY ...] The SELECT and FROM clauses are required in every query that retrieves data; update | |
DELETE Queries in JPA/JPQL As explained in Chapter 2 , you can delete entities from the database by following these steps: Retrieve the entities into an EntityManager . Remove these objects from the EntityManager ... an alternative way to delete entities. Unlike SELECT queries, which retrieve data from the database | |
Strings in JPQL and Criteria Queries found. The optional third argument specifies the position from which to start the search. LOWER ... ([[LEADING|TRAILING|BOTH] [char] FROM ] str) function returns a string after removing leading ... ' . TRIM(LEADING FROM ' UK ') is evaluated to 'UK ' . TRIM(TRAILING FROM ' UK ') is evaluated to ' UK | |
JPA Criteria API Queries: SELECT c FROM Country c You can build an equivalent query with the JPA Criteria API as follows ... = q. from (Country.class); q. select (c); The CriteriaBuilder interface is the main factory for Criteria queries and their elements. You can get an instance from either the EntityManagerFactory 's | |
jakarta.persistence.criteria.PluralJoin , From , Path , FetchParent , Expression , Selection , TupleElement The PluralJoin interface defines ... reassigned. Returns the same selection item. Inherited from Selection Parameters: name - alias ... failure. Inherited from Expression Parameters: type - intended type of the expression Returns: new | |
jakarta.persistence.criteria.MapJoin Interfaces: PluralJoin , Join , From , Path , FetchParent , Expression , Selection , TupleElement ... , an alias cannot be changed or reassigned. Returns the same selection item. Inherited from Selection ... : may result in a runtime failure. Inherited from Expression Parameters: type - intended type | |
jakarta.persistence.criteria.SetJoin , From , Path , FetchParent , Expression , Selection , TupleElement The SetJoin interface is the type ... reassigned. Returns the same selection item. Inherited from Selection Parameters: name - alias Returns ... . Inherited from Expression Parameters: type - intended type of the expression Returns: new expression |