ObjectDB Database Search

1-50 of 200 results

ORDER BY clause (JPQL / Criteria API)

The ORDER BY clause specifies a required order for the query results. Any JPQL query that does not include an ORDER BY clause produces results in an undefined and non-deterministic order . ORDER BY ... is at least one million people, ordered by the country name: SELECT c.name FROM Country c WHERE c.population 1000000

GROUP BY and HAVING clauses

The GROUP BY clause enables grouping of query results. A JPQL query with a GROUP BY clause returns properties of generated groups instead of individual objects and fields. The position of a GROUP BY clause in the query execution order is after the FROM and WHERE clauses, but before the SELECT

jakarta.persistence.criteria.Order

Jakarta Persistence (JPA) Interface jakarta.persistence.criteria. Order An object that defines an ordering over the query results. Since: Jakarta Persistence (JPA) 2.0 The ORDER BY clause (JPQL / Criteria API) article explains how to use Order . Public Instance Methods Expression getExpression

Problem with distinct select, order by and equivalent alias/attribute path

when ordering the results of some projection when the order by expression is different (though logically ... ;  + " order by s_location.id asc";         ... ;  + " order by s.location.id asc";        

java.lang.NullPointerException when using ORDER BY

== 0)) ORDER BY r.startDateTime DESC If we remove the ORDER BY part, the query completes OK ... am not sure if this problem is related to the other as the query works if you remove the order by ... which is used in the order by part, it always has a value. Anyway, we tried fixing the indices

Database Explorer

command. The order of elements in an ordered collection can be modified by using the Edit Move Element ... ] and the [Hidden Fields] lists. You can change the order of the fields shown by using the Up and Down arrow buttons or the [Field Ordering ] combo box. A view for a class can also be set by right

Criteria Query Selection and Results

The JPA Criteria API interfaces in this group are used for setting the SELECT and ORDER BY clauses ... of Selection : See the SELECT in Criteria Queries section for more details and examples. ORDER BY Clause Elements Elements in the ORDER BY clause are represented by the Order interface: The Order

jakarta.persistence.criteria.CriteriaQuery.orderBy(Order...)

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 ordering , if any, is simply removed, and results will be returned in no particular

jakarta.persistence.criteria.Order.reverse()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Order Order reverse() Switch the ordering . Returns: a new Order instance with the reversed ordering . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.Order.isAscending()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Order boolean isAscending() Whether ascending ordering is in effect. Returns: boolean indicating whether ordering is ascending. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.Order.getExpression()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Order Expression getExpression() Return the expression that is used for ordering . Returns: expression used for ordering . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.Order.getNullPrecedence()

Jakarta Persistence (JPA) Method in jakarta.persistence.criteria. Order Nulls getNullPrecedence() Return the precedence of null values. Returns: the precedence of null values . Since: Jakarta Persistence (JPA) 3.2

Index Definition

because the index uses the lexicographic order of the words and is not ordered by the length of the words ... Querying without indexes requires iteration over entity objects in the database one by ... on more than one persistent field. It is defined by specifying multiple fields in the members attribute

JPA Lifecycle Events

and are invoked automatically by JPA when these events occur. Internal Callback Methods Internal callback ... - after an entity has been retrieved from the database. @PreUpdate - when an entity is identified as modified by ... for the same event. However, the same method may be used for multiple callback events by marking

JPA Primary Key

Primary Keys for Object Clustering Entity objects are physically stored in the database ordered by ... ; } Because entity objects are ordered in the database by their primary key, events of the same sensor ... the database is uniquely identified (and can be retrieved from the database) by the combination of its type

Database Management Settings

the size by which to extend the database file when additional space is needed. Small initial size and resize values save space. Larger values can improve performance by reducing file fragmentation (many ... When enabled, a recovery file is created by ObjectDB when a database is opened and deleted by ObjectDB

JPA Entity Fields

Map . For an inverse list field, the order of the retrieved owner entities can be set by the OrderBy ... of the following query: SELECT e FROM Employee e WHERE e.department = :d ORDER BY e.name The specified field ... (Mapped By ) fields Primary key (ID) fields Version field The first three groups (transient

JPA Query Structure (JPQL / Criteria)

...]] [ ORDER BY ...] The first two clauses, SELECT and FROM are required in every retrieval query ... , HAVING and ORDER BY are optional. The structure of JPQL DELETE and UPDATE queries is simpler: DELETE ... , ...). Criteria ORDER BY  ( orderBy , Order , asc , desc ).

Eclipse Public License - v 1.0

additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or ... entity that distributes the Program. "Licensed Patents" mean patent claims licensable by

Query Parameters in JPA

) The following method retrieves a Country object from the database by its name: public Country ... method supports method chaining ( by returning the same TypedQuery instance on which it was invoked ... identified in a query string by their special form, which is a colon (:) followed by a valid JPQL

ObjectDB Object Database Features

and aggregates ). ORDER BY (including ASC, DESC). Aggregates (COUNT, SUM, AVG, MAX, MIN). Query ... Databases are also supported by ObjectDB. The combination of Object Database features ... (limited only by operating system resources). Unlimited CPUs and cores. Reliability and Stability

Locking in JPA

update collisions resulting from simultaneous updates to the same data by two concurrent users. Locking ... by another transaction. When using ObjectDB, optimistic locking is enabled by default and fully ... is automatically increased by one. Version numbers are managed internally but can be exposed by defining

JPA Criteria API Queries

( where ). GROUP BY / HAVING clauses ( groupBy , having , count , sum , avg , min , max , ...). ORDER BY ... , are defined by the instantiation of Java objects that represent query elements. A major advantage ... factory of criteria queries and criteria query elements. It can be obtained either by

JPA Class Enhancer

ObjectDB Enhancer is a post compilation tool that improves performance by modifying the byte code ... (and actually required by JPA but not enforced by ObjectDB) to avoid accessing persistent fields ... should be used (e.g. by using the get and set methods). If you follow this practice only user defined

Paths and Types in JPQL and Criteria API

classes) are represented in JPQL by the following types of expressions: Variables - FROM ... and functions (e.g. for strings and for numbers ), they can be compared by all six comparison operators , and they can be used in ordering . Navigation through Path Expressions A path expression always starts

FROM clause (JPQL / Criteria API)

at the WHERE clause level by using a type expression . For example, in the following query, c iterates ... , and the same query can also be written as follows: SELECT c FROM Country c By default, the name ... name). The default name can be overridden by specifying another name explicitly in the @Entity 's

Shared (L2) Entity Cache

an entity object that is already managed by the  EntityManager returns the existing instance from ... objects, which is managed by the EntityManagerFactory and shared by all its EntityManager objects ... . The scope of these server side caches is wider, since they exist per database and are shared by

Database Replication and Clustering

these details to connect to the master server in order to listen to updates. The updates ... ObjectDB server can manage different types of databases, including master databases, slave database ( by ... The configuration above demonstrates a situation in which the master database is managed by a server

JPA Query Expressions (JPQL / Criteria)

consists of clauses - SELECT, FROM, WHERE, GROUP BY , HAVING and ORDER BY , and each clause consists ... of at least one atomic component. More complex query expressions are built by combining atomic ... the following operators (in order of decreasing precedence): Navigation operator (.) Arithmetic operators

Obtaining a JPA Database Connection

In JPA a database connection is represented by the EntityManager interface. Therefore, in order ... to get an EntityManager instance. JPA requires the definition of a persistence unit in an XML file in order ... by ObjectDB to be a database URL rather than a persistence unit name. The $objectdb variable

JPA Queries

are organized in this reference into three groups. SELECT and ORDER BY elements (including tuples): FROM clause ... Queries are represented in JPA  by the Query and TypedQuery interfaces: The JPA Query API ... that is known only at runtime (e.g. depending on which fields are filled by a user in a form

jakarta.persistence.criteria.CriteriaQuery

predicate. Since: Jakarta Persistence (JPA) 1.0 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. Returns: the list of ordering expressions

DELETE Queries in JPA/JPQL

, and cannot include the GROUP BY , HAVING and ORDER BY clauses. A WHERE clause, which is essential ... As explained in chapter 2 , entity objects can be deleted from the database by ... ;within an active transaction, either explicitly  by calling the  remove method or implicitly

UPDATE SET Queries in JPA/JPQL

UPDATE queries cannot include the GROUP BY , HAVING and ORDER BY clauses, but the WHERE clause ... Existing entity objects can be updated, as explained in chapter 2 , by : Retrieving ... ;within an active transaction. Applying changes to the database by calling the commit method. JPQL UPDATE queries

Setting and Tuning of JPA Queries

in Query and TypedQuery support method chaining ( by returning the query object ... is executed, uncommitted database changes (if any) have to be flushed to the database in order to be visible to the query. Flush policy in JPA is represented by the FlushModeType enum, which has two values

ObjectDB 2.9 Developer's Guide

A prior knowledge of database programming (SQL, JDBC, ORM or JPA) is not required in order to follow ... . Further Reading and Resources This guide focuses mainly on practical issues in order to make the reader proficient in a short time. After reading this guide you may want to extend your knowledge of JPA by reading a book on JPA.

Database Doctor

of a corrupted ObjectDB database file Repairs a corrupted ObjectDB database file by creating a new ... - if the recovery file is disabled. Using the database file simultaneously by two instances ... . Modifying the database file externally not through ObjectDB (e.g. by malicious software such as

jakarta.persistence.criteria.CriteriaBuilder

. Since: Jakarta Persistence (JPA) 3.2 Order asc ( Expression expression ) Create an ordering by ... asc ( Expression expression , Nulls nullPrecedence ) Create an ordering by the ascending value ... an ordering by the descending value of the expression. Parameters: expression - expression used

Deleting JPA Entity Objects

Existing entity objects can be deleted from the database either explicitly by invoking the remove method or implicitly as a result of a cascade operation. Explicit Remove In order to delete ... committed the object is not deleted. An IllegalArgumentException is thrown by remove if the argument

SSL Configuration

"false" ) specifies if SSL is used. As shown above, SSL is disabled by default. It could be enabled ... signature. This file is generated from the Keystore file by omitting the private key ... . If authenticating the client machine by the server is also required a Keystore file (which might be different

What is the Java Persistence API (JPA)?

) is that in JPA data is represented by classes and objects rather than by tables and records as in ... order to interact with a relational database such as Oracle, DB2, SQL Server or MySQL. The popular JPA ... of the Java Persistence API (JPA). By interacting with ObjectDB using standard JPA

Chapter 4 - JPA Queries (JPQL / Criteria)

(and a criteria query) is explained by describing the main clauses of JPQL queries (SELECT, FROM, WHERE, GROUP BY , HAVING, ORDER BY ): Then the expressions that are used for building JPQL and criteria query

Strings in JPQL and Criteria Queries

(for any c.name value). To match an actual underscore or percent character it has to be preceded by ... to ' UK' . TRIM(BOTH FROM ' UK ') is evaluated to 'UK' . By default, space characters are removed ... order to support optional arguments and when applicable simple Java objects as well as criteria expressions.

What are the main benefits of using ObjectDB?

By using ObjectDB you can reduce development time and costs and improve your application ... fields can be stored by ObjectDB simply as part of the containing object. Relational databases lack that ability and require multiple tables, multiple records and join operations in order to support

jakarta.persistence.OrderBy

, ordering by the primary key of the associated entity is assumed. The property or field name ... is applied to an element collection of basic type, the ordering is by value of the basic objects ... = "students") @OrderBy // ordering by primary key is assumed public List getCourses() { ... } ... } Example 3

Step 3: Define an EJB Session Bean

getAllGuests() { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class ... Operations on the database will be performed by an instance of a session bean (EJB) class that we will define in this step: Open the [New Session Bean] dialog box by right clicking the guest package

Step 3: Define an EJB Session Bean

Guest g ORDER BY g.id", Guest.class); return query.getResultList(); } } The GuestDao session bean (EJB ... Operations on the database will be performed by an instance of a session bean (EJB) class that we will define in this step: Open the [New Java Class] dialog box by right clicking the guest package

Step 3: Define a Spring DAO Component

() { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class); return ... Operations on the database will be performed by an instance of a Data Access Object (DAO) that we will define in this step as a Spring MVC component: Open the [New Java Class] dialog box by right

Step 3: Define a Spring DAO Component

getAllGuests() { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class); return ... Operations on the database will be performed by an instance of a Data Access Object (DAO) that we will define in this step as a Spring MVC component: Open the [New Java Class] dialog box by right

JPA Tutorials

Tutorial Only basic Java experience is required in order to follow this tutorial. Web Application ... by step instructions on how to create the sample applications. In addition, the sample applications