ObjectDB Database Search

1-50 of 200 results

ORDER BY clause (JPQL / Criteria API)

The ORDER BY clause specifies the order for the query results. Any JPQL query that does not include an ORDER BY clause returns results in an undefined and non-deterministic order . ORDER BY ... , ordered by country name: SELECT c.name FROM Country c WHERE c.population 1000000 ORDER BY c.name

GROUP BY and HAVING clauses

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

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

Strange behaviour with ORDER BY and IN

performance I noticed a strange behaviour where an ORDER BY - directive isn't executed as ... if we order by a simple member (e.g. a String) being the Entity-ID and, at the same time, filter ... ("Locations without selection criterion in descending order ( by id): ");      

ORDER BY problem, when String starts with language specific character

Dear all, I have a problem with ORDER BY clause. I have a simple query: select u from User u order by u.name When the name starts with "normal/english" character, records are ordered correctly ... ORDER BY clause. However, if you have to sort a large result list - it might be more efficient

Cannot sort descending, when ordering by caluculated float in a method

Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem ... this query: (I know, it's not very efficient...) select i from Invoice i order by i.getPrice() desc/asc ... ORDER BY i.getPrice() DESC");         List resultList = query

NULL prefered in ORDER BY?

Hi! Is there a way to NOT prefer NULL in Order BY ? I.e. assume this: @Entity class Hint {   ... do something like SELECT FROM Test ORDER BY hint.name It orders ASC like this (assuming I've got ... supported. null values are smaller than any other value so they appear first in ordering

order by string with numbers

  The sql that works is ORDER BY CAST(SUBSTR(username FROM 4) AS UNSIGNED) ASC Using JPQL SELECT u FROM Users u ORDER BY SUBSTRING(u.username,4)*1 ASC If you have other alternative for JPA ... Hi Anyone could help me I need to order a string  for example user1, user2, ..., user1000 I

Database Explorer

between the Shown Fields and Hidden Fields lists. You can change the order of the shown fields by ... , you must specify the path to the file. Alternatively, you can run the Explorer by double-clicking explorer.jar ... a database path on the server, which you can do by using the Browse button. You can also open recently used

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

JPA Criteria Query Selection and Results

and ordering , mirroring the SELECT and ORDER BY clauses in JPQL or SQL. These interfaces allow you to specify ... class). For more information, see the SELECT in Criteria Queries section. ORDER BY clause elements Result ordering is represented by : Specifies an ordering on a query expression, supporting

JPA Query Structure (JPQL / Criteria)

...]] [ ORDER BY ...] The SELECT and FROM clauses are required in every query that retrieves data; update ... , HAVING , and ORDER BY are optional. The structure of JPQL DELETE and UPDATE queries is simpler: DELETE ... , max , ...) Criteria ORDER BY ( orderBy , Order , asc , desc )

JPA Entity Fields

, you can set the order of the retrieved owner entities by using the @OrderBy annotation: @Entity ... Employee e WHERE e.department = :d ORDER BY e.name The specified field ( "name" ) must be a sortable ... and final entity fields are always considered transient. You can declare other fields as transient by using

JPA Lifecycle Events

annotation. By default, callback methods in a superclass are also invoked for entities of its subclasses ... attached to an entity class are inherited by its subclasses. To prevent this inheritance, add ... NoDefaultListenersForThisEntityEither extends NoDefaultListenersForThisEntity { } Callback invocation order When multiple callback

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

JPA Primary Key

. Using primary keys for object clustering Entities are physically stored in the database ordered by ... and can be retrieved by the combination of its type and its primary key. Primary key values must be unique for each ... part of their containing entities and do not have a separate identity. Automatic primary key By default

ObjectDB Object Database Features

). ORDER BY (including ASC, DESC). Aggregates (COUNT, SUM, AVG, MAX, MIN). Query Expressions Path ... 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 Recovery

Index Definition

A composite index is an index on more than one persistent field. Define a composite index by specifying ... is an ordered map data structure that ObjectDB maintains in the file system, not in memory. The B ... is sorted lexicographically by word, not by word length. In summary, if an index contains all the fields in

JPA Criteria API Queries

BY and HAVING clauses ( groupBy , having , count , sum , avg , min , max , ...) ORDER BY clause ... are defined as strings, similar to SQL. In contrast, JPA Criteria queries are defined by instantiating ... ); List results = query. getResultList (); Because both types of queries are ultimately represented by

FROM clause (JPQL / Criteria API)

By default, the name of an entity class in a JPQL query is the unqualified name of the class (for example, Country with no package name). The default name can be overridden by specifying another name ... to a single-value expression are less commonly used because they can usually be replaced by

Paths and Types in JPQL and Criteria API

by all six comparison operators and used for ordering . Navigation through path expressions A path ... classes) are represented in JPQL by the following types of expressions: Variables : FROM ... persistent classes can participate in direct comparisons by using the = and operators

Query Parameters in JPA

a Country object from the database by its name: public Country getCountryByName( EntityManager em ... a value for the parameter by using the setParameter method. The setParameter method supports method chaining by returning the TypedQuery instance on which it was invoked. This allows you to chain

JPA Query Expressions (JPQL / Criteria)

, such as SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY . Each clause is composed of JPQL or ... of at least one atomic component. More complex query expressions are built by combining atomic expressions ... operators, listed in order of decreasing precedence: Navigation operator ( . ) Arithmetic operators

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

JPA Metamodel Attributes

are represented by : Represents single-valued attributes. This includes basic types (primitives ... ) with "To-One" cardinality. Plural (collection) attributes Collection-valued attributes are represented by ... . Represents an attribute typed as a java.util.Set , implying unique elements without a specific order

JPA Criteria Queries

to define SELECT, WHERE , GROUP BY , and ORDER BY clauses. To execute the query, pass the instance ... ; CriteriaQuery , CriteriaUpdate , and  CriteriaDelete are first built by static methods ... (Note: Subqueries are currently not supported by ObjectDB). Top-level queries and subqueries share

UPDATE SET Queries in JPA/JPQL

. However, they do not support the GROUP BY , HAVING , and ORDER BY clauses. For example, the following ... You can update existing entities, as explained in chapter 2 , by following these steps: Retrieve ... . Apply the changes to the database by calling the commit method. JPQL UPDATE queries provide

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.

JPA Relationships Annotations

Relationships define associations between entities. They are represented In Java code by ... the ordering and mapping of collection-based relationships using these annotations: Specifies the ordering of elements in a List-valued association at the time of retrieval. Specifies the attribute

DELETE Queries in JPA/JPQL

cannot include multiple variables, JOIN clauses, or the GROUP BY , HAVING , and ORDER BY clauses ... As explained in Chapter 2 , you can delete entities from the database by following these steps ... within an active transaction, either explicitly by calling the remove method or implicitly through a cascading

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

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)

). The first section explains the structure of a JPQL query and a criteria query by describing the main clauses: SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY : The next section explains

JPA Queries

the query clauses. Elements used to define the SELECT and ORDER BY clauses. Elements for the FROM ... these core interfaces: The base interface for executing queries in JPA. It is often replaced by

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

jakarta.persistence.OrderColumn

and maintained by the application. The OrderBy annotation is not used when OrderColumn is specified. The order ... : Annotation Target: Method, Field Specifies a column that is used to maintain the persistent order of a list. The persistence provider is responsible for maintaining the order upon retrieval and in

Alias not used in ORDER BY

would have expected the alias to be used in the ORDER BY clause, something like SELECT $1, UPPER($1.someStringProperty) AS TEST FROM T ORDER BY TEST However what I actually get as query string is SELECT $1, UPPER($1.someStringProperty) AS TEST FROM T ORDER BY UPPER($1.someStringProperty) This doesn't

jakarta.persistence.EntityManager

arguments must be specified in the order in which the result sets is returned by the stored procedure ... must be specified in the order in which the result sets is returned by the stored procedure ... via a call to close , to allow resources to be cleaned up by the persistence provider. This approach places

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