ObjectDB Database Search
1-50 of 200 resultsSetting and Tuning of JPA Queries
The Query and TypedQuery interfaces define various methods for setting and tuning query execution . To take effect, you must invoke these methods before running a query with getResultList or ... let you define a result window, which is a portion of a large query result list. The setFirstResult
|
|
Query Parameters in JPA
Query parameters enable you to define reusable queries . You can execute these queries with different parameter values to retrieve different results. Executing the same query multiple times with different parameter values is more efficient than using a new query string for each execution
|
|
Running JPA Queries
The Query interface defines two methods for running SELECT queries : Query .getSingleResult () : Use when exactly one result object is expected. Query .getResultList () : Use in any other case ... addition, the Query interface defines a method for running DELETE and UPDATE queries : Query
|
|
JPA Named Queries
A named query is a statically defined query with a predefined, unchangeable query string. Using named queries instead of dynamic queries can improve code organization by separating JPQL query strings from Java code. This practice also enforces the use of query parameters instead of embedding
|
|
JPA Query API
Jakarta Persistence (JPA) represents queries with two interfaces: the Query interface, which was the only query interface in JPA 1, and the TypedQuery interface, which was introduced in JPA 2. The TypedQuery interface extends the Query interface. Use the Query interface primarily when the query
|
|
JPA Queries
Jakarta Persistence provides powerful APIs for executing database queries using JPQL strings or the programmatic Criteria API. These interfaces support both static and dynamic query construction with full type safety. General query objects Execute SELECT, UPDATE and DELETE queries in JPA using
|
|
JPA Criteria Queries
to string-based JPQL for constructing dynamic queries , ensuring compile-time safety and facilitating ... queries : Criteria Queries Hierarchy in Jakarta Persistence (JPA) 3.2 Instances of  ... of CriteriaBuilder as mutable empty objects, and then defined using setter methods. All query types (SELECT
|
|
JPA Query Structure (JPQL / Criteria)
The syntax of the Jakarta Persistence Query Language (JPQL) is similar to SQL. This is a key advantage because SQL is a powerful query language, and many developers are already familiar ... operates on Java classes and objects. For example, a JPQL query can retrieve entities, unlike SQL
|
|
DELETE Queries in JPA/JPQL
operation. Apply changes to the database by calling the commit method. JPQL DELETE queries provide an alternative way to delete entities. Unlike SELECT queries , which retrieve data from the database, DELETE queries remove specified entities from the database. Using a DELETE query to remove entities
|
|
JPA Criteria Query Expressions
Jakarta Persistence (JPA) Criteria API uses a hierarchy of interfaces to model query conditions and selections, enabling the construction of dynamic, type-safe queries . These interfaces represent the building blocks for defining query logic programmatically. The hierarchy of the expression
|
|
JPA Named Queries Annotations
Jakarta Persistence (JPA) provides annotations to define static, reusable queries at the class level, separating query logic from business code. Query definitions Declare named queries using the following annotations: Specifies a static, named query in the Jakarta Persistence Query Language (JPQL
|
|
SQL Queries Annotations
Jakarta Persistence (JPA) provides a set of annotations to define and map native SQL queries when the standard Java Persistence Query Language (JPQL) is insufficient. While ObjectDB focuses on JPQL ... databases through specific SQL dialects. Native query definitions Define raw SQL queries using
|
|
JPA Query Expressions (JPQL / Criteria)
JPQL and criteria queries are built on query expressions. Every query consists of clauses ... Criteria API expressions. Atomic expressions The atomic query expressions are: JPQL / Criteria Variables JPQL / Criteria Parameters JPQL / Criteria Literals Every query expression consists
|
|
Strings in JPQL and Criteria Queries
String values can appear in JPQL queries in several forms: As string literals , for example, 'abc' and '' . As parameters when string values are passed as query arguments. As path expressions ... . Criteria query string expressions Query String Expressions The JPQL string operators and functions
|
|
Date and Time in JPQL and Criteria Queries
Date and time expressions can appear in JPQL queries in the following ways: As date and time ... when the query is executed: CURRENT_DATE : Returns the current date as a java.sql.Date instance. CURRENT_TIME ... . Date and time in criteria queries The CriteriaBuilder interface provides three factory methods
|
|
Collections in JPQL and Criteria Queries
Collections can appear in JPQL queries in the following ways: As parameters when a collection ... to check other collections, such as a collection passed as a query parameter. For example: 'English' IN ... are synonyms. Criteria query collection expressions The JPQL collection operators and functions
|
|
Literals in JPQL and Criteria Queries
type literals (for example, Country ). Use JPQL literals sparingly. Queries that use parameters ... times with different parameter values. Embed literals in JPQL queries only when a single, constant ... '} . For example: {ts '2020-01-03 13:59:59'} Enum literals Enum literals in JPQL queries use the standard Java
|
|
Numbers in JPQL and Criteria Queries
Numeric values can appear in JPQL queries in several forms: As numeric literals , such as 123 ... type and always returns a double value. Criteria query arithmetic expressions JPQL arithmetic operators and functions (which are described above) are available also as JPA criteria query expressions
|
|
JPA Criteria Query Date/Time Extraction
Jakarta Persistence criteria queries use the following interfaces and enums to extract temporal components like year, month, or hour from date and time values. TemporalField # Base interface ... a criteria query specify the enum value that represents that component as the first argument of 
|
|
FROM clause (JPQL / Criteria API)
The FROM clause declares query identification variables for iterating over objects in the database. A query identification variable is similar to a variable in a Java enhanced for loop because both are used to iterate over objects. Range variables Range variables are query identification variables
|
|
SELECT clause (JPQL / Criteria API)
query returns Country objects, which then become managed by the EntityManager instance em : TypedQuery query = em. createQuery ("SELECT c FROM Country c", Country.class); List results = query ... for deletion , and so on. Query results are not limited to entities. You can use almost any valid JPQL
|
|
jakarta.persistence.EntityManagerFactory.addNamedQuery(String,Query)
( String name , Query query ) Define the query , typed query , or stored procedure query as a named query such that future query objects can be created from it using ... of the query object (except for actual parameter binding) in effect when the named query is added
|
|
jakarta.persistence.QueryTimeoutException.QueryTimeoutException(Query)
Jakarta Persistence (JPA) Constructor in jakarta.persistence.QueryTimeoutException QueryTimeoutException ( Query query ) Constructs a new QueryTimeoutException exception with the specified query . Parameters: query - the query . Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.QueryTimeoutException.QueryTimeoutException(String,Throwable,Query)
QueryTimeoutException ( String message , Throwable cause , Query query ) Constructs a new QueryTimeoutException exception with the specified detail message, cause, and query . Parameters: cause - the cause. message - the detail message. query - the query . Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.NamedQuery.query
Jakarta Persistence (JPA) Method in jakarta.persistence.NamedQuery String query (Required) The query string in the Jakarta Persistence query language. Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.NamedNativeQuery.query
Jakarta Persistence (JPA) Method in jakarta.persistence.NamedNativeQuery String query The native SQL query string. Since: Jakarta Persistence (JPA) 1.0
|
|
jakarta.persistence.QueryTimeoutException.query
Jakarta Persistence (JPA) Field in jakarta.persistence.QueryTimeoutException query Since: Jakarta Persistence (JPA) 1.0
|
|
WHERE clause (JPQL / Criteria API)
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 ... to the SELECT clause to be collected as query results, the WHERE clause acts as a filter. The boolean
|
|
JPA Runtime Tuning & Configuration
dynamic options that control runtime behavior and allow you to adjust settings per session, query , or ... every operation in that session. Query (definition): Settings applied to a Query object override session defaults for that query . Operation (argument): Settings passed to specific EntityManager operations ( find
|
|
jakarta.persistence.TypedQuery
Jakarta Persistence (JPA) Interface jakarta.persistence.TypedQuery Type Parameters: - query result type Super Interfaces: Query Interface used to control the execution of typed queries . See Also: Query Parameter Since: Jakarta Persistence (JPA) 2.0 Chapter 4 - JPA Queries (JPQL / Criteria
|
|
Database Management Settings
, which modify the database. For debugging query failures, you might need to record "all" operations to reproduce ... can use the new indexes to accelerate relevant queries . The element The element specifies settings for the two query cache mechanisms that ObjectDB manages: The results attribute specifies the size
|
|
JPA Entity Fields
an automatic query when the entity is retrieved. Note : Navigation through inverse fields is much less efficient than navigation through ordinary persistent fields because it requires running queries ... the following query , where :d represents the Department entity: SELECT e FROM Employee e WHERE e.department
|
|
Retrieving JPA Entities
its persistence context, it returns the existing managed object without querying the database. Otherwise, JPA ... , getReference might return a hollow object instead of querying the database immediately. It never returns null ... an entity and another for checking a persistent field of an entity. Retrieval by query The Query
|
|
Index Definition
Querying without indexes requires sequential iteration over entities in the database. If many ... this full iteration, allowing complex queries over millions of objects to execute quickly ... lastName; Address address; : } Indexes in queries ObjectDB manages a B-tree for every index. A B-tree
|
|
jakarta.persistence.EntityManager
their primary key, and execute queries which range over entity types. An entity may be disassociated from ... must also be flushed before execution of any query whose result set would be affected by unflushed modifications ... accepts LockOption s. See Also: Query TypedQuery CriteriaQuery PersistenceContext
|
|
Logical Operators in JPQL and Criteria API
Logical operators in JPQL and JPA criteria queries combine simple Boolean expressions to form ... , while Java uses its own notation, which is also used by the JDO Query Language (JDOQL). ObjectDB supports both notations. Binary AND (&&) operator The following query retrieves countries whose population
|
|
jakarta.persistence.criteria.CriteriaQuery
, CommonAbstractCriteria The CriteriaQuery interface defines functionality that is specific to top-level queries . Since: Jakarta Persistence (JPA) 2.0 The JPA Criteria API Queries article explains how to use ... query results are eliminated. A true value will cause duplicates to be eliminated. A false value
|
|
Is ObjectDB a NoSQL Database?
of NoSQL technology, which are weak query capabilities and lack of ACID (atomicity, consistency, isolation, durability). Unlike other NoSQL solutions, ObjectDB provides full support of rich complex queries , using two standard Java query languages: JPQL (Java Persistence Query Language) and JDOQL (JDO
|
|
Is ObjectDB better than competing object databases?
do not support aggregate queries (max, min, count, sum and avg). ObjectDB supports rich queries , including aggregate queries , as part of its support of JPQL (JPA Query Language) and JDOQL (JDO Query Language). ObjectDB is faster than other products.
|
|
JPA Extended API Reference Guide
, query facilities, metamodel details, configuration options, annotations, and exception information ... the fundamental classes and interfaces for entity management and persistence operations. Covers the query API, criteria queries , and JPQL for data retrieval and manipulation. Describes the metamodel and graph APIs
|
|
What are the main benefits of using ObjectDB?
processes JPQL (JPA Query Language) and JDOQL (JDO Query Language) queries directly, where ORM tools first convert these queries to SQL and then transition the SQL to the DBMS for execution through a JDBC
|
|
jakarta.persistence.criteria.AbstractQuery
functionality that is common to both top-level queries and subqueries. It is not intended to be used directly in query construction. All queries must have: a set of root entities (which may in turn own joins). All queries may have: a conjunction of restrictions. Since: Jakarta Persistence (JPA) 2.0
|
|
jakarta.persistence.criteria.Subquery
a subquery root correlated to a root of the enclosing query . Parameters: parentRoot - a root of the containing query Returns: subquery root. Since: Jakarta Persistence (JPA) 1.0 Join correlate ( Join parentJoin ) Create a subquery join object correlated to a join object of the enclosing query
|
|
jakarta.persistence.criteria.CriteriaBuilder
criteria queries , compound selections, expressions, predicates, orderings. Note that Predicate ... compatible with varags. Since: Jakarta Persistence (JPA) 2.0 The JPA Criteria API Queries article ... to specify a constructor that is applied to the results of the query execution. If the constructor
|
|
JPA Persistable Types
are represented in queries by entity names . By default, the entity name is the unqualified name ... entities, and they cannot be queried directly). Therefore, the decision to declare a class as an entity or ... and retrieval). Simplifies queries on dates and date ranges. When an entity is stored, its date
|
|
JPA Metamodel and Graphs
, and their attributes to build dynamic queries and validate persistence structures. The Metamodel Access ... and further explanation, refer to the JPA Metamodel API section in the ObjectDB manual. Criteria query ... objects that can be bound to a Path in a Criteria query , mainly to define FROM variables
|
|
Deleting JPA Entities
the database. DELETE Queries DELETE queries provide an alternative way to remove entities from the database. They are especially useful for deleting many entities in a single operation. For more information, see DELETE Queries in JPA/JPQL .
|
|
jakarta.persistence.EntityManagerFactory
, may be obtained by calling getCache , the CriteriaBuilder , used to define criteria queries , may be obtained by ... entityGraph - entity graph Since: Jakarta Persistence (JPA) 2.1 void addNamedQuery ( String name , Query query ) Define the query , typed query , or stored procedure query as a named query such that future query
|
|
[ODB1] Chapter 9 - ObjectDB Explorer
to browse databases, execute JDOQL queries , create new databases and edit the content of existing ... to explore database objects visually, navigate among them and execute queries is very valuable ... that the database contains (root objects are discussed in chapter 6 ). The " Query " window enables a user
|
|
[ODB1] Chapter 6 - Persistent Objects
classes are not included in the extents of their classes, so they cannot be iterated or queried directly ... one. If more selective retrieval is needed, a Query can be used to retrieve only objects that satisfy some ... (the commented line in the code above). Retrieval by Query The most advanced method for retrieving objects from
|