ObjectDB ObjectDB

Internal Website Search

1-10 of 200 resultsRefresh

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

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";         System.out.println("Working query ... "             + "left join s.location as s_location "             + "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 ... 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 with the Doctor

Strange behaviour with ORDER BY and IN

performance I noticed a strange behaviour where an ORDER BY - directive isn't executed as ... ("Locations without selection criterion in descending order (by id): ");         em.createQuery("select l from Location l order by l.id desc", Location.class)             .getResultList().forEach(l

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

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 ... GROUP BY / HAVING (groupBy, having, count, sum, avg, min, max, ...). Criteria ORDER BY (orderBy, Order, asc, desc).

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

Criteria Query Selection and Results

The JPA Criteria API interfaces in this group are used for setting the SELECT and ORDER BY clauses ... : 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 interface is a thin wrapper


Method javax.jdo.Query void setOrdering( String ordering ) Set the ordering specification for the result Collection. The ordering specification is a String containing one or more ordering declarations separated by commas. Each ordering declaration is the name of the field on which to order

[ODB1] Chapter 7 - JDOQL Queries

rather than by order): Query query = pm.newQuery(Person.class); query.declareParameters("int age1, int ... by their full name without using an import declaration. 7.6 Ordering the Results A result collection can be ordered by a query. For example: Query query = pm.newQuery(Person.class, "this.age >= 18

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support