About GROUP BY

api-jpa

JPA Queries

Reference (JavaDoc) of all the JPA query types, including Query, TypedQuery, CriteriaBuilder, CriteriaQuery, Tuple, Root, Expression, Order, etc. Queries are represented in JPA by the Query and TypedQuery interfaces: ... at runtime (e.g. depending on which fields are filled by a user in a form) can be done by concatenating JPQL strings into a valid complete JPQL query. JPA 2 ...

 
manual

Comparison in JPQL and Criteria API

Explains how comparison operators can be used in JPQL queries, including in comparing null values.... where Java uses its own notation (which is also in use by JDOQL, the JDO Query Language). ObjectDB supports both forms. Besides the ... comparison of any two values that belong to the same group as detailed above. Therefore, for example, a double value can be ...

 
forum_thread

Using aliases in WHERE clause

Hi, I'm trying to run query : SELECT DISTINCT ppi.inquiries AS i FROM ProjectPartInfo ppi WHERE i.status IS NOT NULL Unfortunately, 'i' alias doesn't work in WHERE clause : Query Execution Error ===================== Unexpected query token 'i' SELECT DISTINCT ppi.inquiries AS i FROM ProjectPartInfo ppi WHERE  ==> i <== .status IS NOT NULL   ... AS i FROM ProjectPartInfo ppi ORDER BY i . id   Is this a bug or should I avoid using ... = "code" > FROM -> WHERE -> GROUP BY -> HAVING -> SELECT -> ORDER BY ...

 
manual

JPA Persistence Unit

Explains how to define a JPA persistence unit in the persistence.xml file.... unit is optional when using ObjectDB, but required by JPA. This page covers the following topics: ... > A persistence unit is defined by a persistence-unit XML element. The required name attribute ( ... JPA implementation should be used. ObjectDB is represented by the com.objectdb.jpa.Provider string. If not specified, the first JPA ...

 
manual

DELETE Queries in JPA/JPQL

Explains how to apply server side bulk delete using a JPA/JPQL query.... 2 , entity objects can be deleted from the database by: Retrieving the entity objects into an EntityManager . ...  within an active transaction, either explicitly by calling the  remove method or implicitly by a cascading ... multiple variables and JOIN, and cannot include the GROUP BY, HAVING and ORDER BY clauses. A WHERE clause, which ...

 
forum_thread

em.flush(); em.clear(); loosing data and not persisting managed objects

I'm having trouble with flush() and clear() in a loop inside a transaction not persisting modified objects to database. Sometimes it does other times it doesn't. Here is my Entity. ... 2.2.3_06] Unexpected exception (Error 990) Generated by Java HotSpot(TM) 64-Bit Server VM 1.6.0_24 (on Linux ... query.compiler] <finalPlans> <groupPlan plan="group(filter(extract($1,type(Notes[all])),($1.addDate!=null)))" eval="3.6979" var="1" prm="1" reg="1" group="null" eval="[max($1.addDate)]"> <filterPlan ...

 
forum_thread

com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV

Hello! This query is working fine SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2 JOIN $1.sender $3 WHERE ($2.id='22afeafe-363f-4397-8553-cc5688ba142d') OR ($3.id='22afeafe-363f-4397-8553-cc5688ba142d')  ORDER BY MAX($1.createDate) DESC   but this query returns an exception "com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV" SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2  ... )   ORDER BY MAX ( $1 . createDate ) DESC   ... ) Apparently the use of MAX without a GROUP BY clause causes problem, because the following query works: ... $2 . id = '22afeafe-363f-4397-8553-cc5688ba142d' GROUP BY $1 ORDER BY MAX ( $1 . createDate ) ...

 
release

2.3.5

... You should start by following a  tutorial or reading the manual . For ... Added support of MEMBER OF for inverse (mapped by) collections. Changed logging of incomplete recovery records ...

 
manual

UPDATE SET Queries in JPA/JPQL

Explains how to apply server side bulk update using a JPA/JPQL query.... can be updated, as explained in chapter 2 , by: Retrieving the entity objects into an EntityManager . ... Update UPDATE queries cannot include the GROUP BY, HAVING and ORDER BY clauses, but the WHERE clause, which ...

 
release

2.3.4

... You should start by following a  tutorial or reading the manual . For ... Added support of MEMBER OF for inverse (mapped by) collections. Changed logging of incomplete recovery records ...