Internal Website Search

1-50 of 200 results

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. When a GROUP BY clause exists in a JPQL query, database objects (or tuples of database objects

ORDER BY clause (JPQL / Criteria API)

BY c.name DESC Grouping ( GROUP BY ) Order The ORDER BY clause is always the last in the query processing chain. If a query contains both an ORDER BY clause and a GROUP BY clause the SELECT clause receives groups rather than individual objects and ORDER BY can order these groups . For example: SELECT c

Grouping by date()

have to group by date(). For few queries I was concatenating 'date' from year()-month()-day() calls ... with new version. When you group by date() there are two days per day. I mean group by divides each day ... with this issue. Query: select hour(ov.created), count(ov) from ObjectView ov group by hour(ov.created) order by

Group by date / time

Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day ... WHERE YEAR(record_date) = 2009 GROUP BY YEAR(record_date), MONTH(record_date) or maybe something like this: SELECT COUNT(id) FROM stats WHERE YEAR(record_date) = 2009 GROUP BY DATE_FORMAT(record_date

Group by: list if no aggregate function is specified

Hello! In a query like SELECT parent, children FROM Parent parent LEFT JOIN p.children children GROUP BY parent  maybe it would be good if it will return a list of Object[2], where the second object is a list of children of a parent. Because creating a query to get a list of parents

JPA Entity Fields

superclasses) can be classified into the following five groups : Transient fields Persistent fields Inverse (Mapped By ) fields Primary key (ID) fields Version field The first three groups (transient ... two groups (primary key and version fields) can only be used in entity classes. Primary key fields

Paths and Types in JPQL and Criteria API

. The SELECT clause counts all these objects (this is an aggregate query with no GROUP BY - all the objects ... can be divided into two main groups : FROM variable expressions , represented by subinterfaces of From ... classes) are represented in JPQL by the following types of expressions: Variables - FROM

ObjectDB Object Database Features

JOIN and JOIN FETCH ). WHERE (with both JPQL and JDOQL expressions). GROUP BY (including HAVING ... , derived attributes, grouping queries and aggregate queries) which are usually missing from Object Oriented Databases are also supported by ObjectDB. The combination of Object Database features

JPA Query Structure (JPQL / Criteria)

;of up to 6 clauses in the following format: SELECT ... FROM ... [WHERE ...] [ GROUP BY ... [HAVING ... (update and delete queries have a slightly different form). The other JPQL clauses, WHERE , GROUP BY ... ;( where ). Criteria GROUP BY / HAVING  ( groupBy , having , count , sum , avg , min , max

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

Comparison in JPQL and Criteria API

its own notation (which is also in use by JDOQL, the JDO Query Language). ObjectDB supports both forms ... by these operators. Comparing NULL values The following table shows how NULL values are handled by ... IS NULL and IS NOT NULL operators which are provided by JPQL (and SQL): c.president IS NULL c.president

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

Criteria Query Selection and Results

The JPA Criteria API interfaces in this group are used for setting the SELECT and ORDER BY clauses ... clause in a criteria query is represented by Selection : Because Selection  is a super interface ... selection expressions can be represented by   CompoundSelection , which is itself a subinterface

DELETE Queries in JPA/JPQL

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  by a cascading operation. Applying changes to the database by calling the commit method. JPQL

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

JPA Criteria API Queries

, join , fetch ). WHERE clause ( where ). GROUP BY / HAVING clauses ( groupBy , having , count , sum ... , 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 Persistence Unit

A JPA Persistence Unit is a logical grouping of user defined persistable classes (entity classes ... is optional when using ObjectDB, but required by JPA. persistence.xml Persistence units are defined in ... A persistence unit is defined by a persistence-unit XML element. The required name attribute ( “my-pu

Criteria Query From Elements

The interfaces in this group are in use for setting a criteria query FROM clause. Criteria Query ... variables are represented in criteria queries by descendant interfaces of the From interface: Range variables (bound by an entity class) are represented by the Root subinterface: Join variables (bound by

JPA Query Expressions (JPQL / Criteria)

Query expressions are the foundations on which JPQL and criteria queries are built. Every query 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

Auto Generated Values

server, IDs are allocated in groups . The number of IDs in each allocation is specified by ... number generator is also used to generate numeric values for primary key fields annotated by ... is 50). A sequence is global to the application and can be used by one or more fields in one or

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

JPA Annotations

JPA defines dozens of annotations that can be divided into the following groups : Annotations for JPA aware classes: Annotations for fields in JPA persistable classes: Annotations for additional JPA ... between a relational database and an object model and for direct SQL queries): These ORM annotations are silently ignored by ObjectDB.

CriteriaQuery.groupBy(grouping) - JPA Method

; Expression ...  grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides

CriteriaQuery.groupBy(grouping) - JPA Method

  grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return type

Subquery.groupBy(grouping) - JPA Method

; grouping ) Specify the expressions that are used to form groups over the subquery results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return type

AbstractQuery.groupBy(grouping) - JPA Method

; Expression ...  grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. Parameters: grouping - zero or

AbstractQuery.groupBy(grouping) - JPA Method

  grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. Parameters: grouping - list of zero or

Subquery.groupBy(grouping) - JPA Method

...  grouping ) Specify the expressions that are used to form groups over the subquery results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return

javax.persistence.criteria.CriteriaQuery

Since: JPA 2.0 List getGroupList () Return a list of the grouping expressions. Returns empty list if no grouping expressions have been specified. Modifications to the list do not affect the query. Return: the list of grouping expressions Inherited from: AbstractQuery Since: JPA 2.0 Predicate

Database Explorer

directory a path to it has to be specified. Alternatively, you can run the Explorer by double clicking explorer.jar or by running explorer.exe (on Windows) or explorer.sh (on Unix/Linux, after editing ... . By default, when the Explorer starts it tries to open a connection to the most recently used

Retrieving JPA Entity Objects

of entity classes and to keep them as simple as possible. Retrieval by Class and Primary Key Every entity object can be uniquely identified and retrieved by the combination of its class and its primary key ... method except that if the entity object is not already managed by the EntityManager a hollow object

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

Apache License, Version 2.0, January 2004

the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright ... and all other entities that control, are controlled by , or are under common control with that entity

Privacy Policy

the Service. By using the Service, You agree to the collection and use of information in accordance ... files that are placed on Your computer, mobile device or any other device by a website, containing ... individuals employed by the Company to facilitate the Service, to provide the Service on behalf

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

[ODB1] Chapter 4 - JDO Metadata

group should include fields that are needed often and are relatively small. By default, the group ... and references to user defined classes are excluded by default. The default-fetch- group attribute ... file. The metadata is used first by the JDO Enhancer, and later by the JDO

Step 1: Create a Maven Web Project

We start by creating a new Maven-WTP dynamic web project in Eclipse: Open the [New Project] dialog box, e.g. by using  File New Project... Select  Maven Maven Project and click  ... Next . Enter Group Id (e.g.  Guestbook ), Artifact Id (e.g.  Guestbook ), Version (e.g

[ODB1] Chapter 3 - Persistent Classes

the default fetch group should not be accessed by this method. void jdoPreDelete() Called ... store methods and code. Only the state of the object as reflected by its persistent fields is stored. Persistent fields, by default, are all the fields that are not defined as static , final or

[ODB1] Chapter 9 - ObjectDB Explorer

.jar my.odb Some JVM arguments can be useful. For instance, by default Java does not use ... . Otherwise, the required executable jar would not be found by explorer.exe. By default, running explorer.exe ... " menu command. By default, when the Explorer starts its opens the last used local database file

Step 1: Create a Maven Web Project

We start by creating a new Maven web project in NetBeans: Open the [New Project] dialog box, e.g. by using File New Project... Select Maven Maven Web Application and click Next . Choose a Project Name (e.g. Guestbook ) and select Java EE 5. Enter Maven Group Id (e.g. com.objectdb.tutorial.spring

Query.setGrouping(group) - JDO Method

. Parameters: group a - comma-delimited list of expressions, optionally followed by the "having" keyword and a boolean expression Since: JDO 2.0 ... JDO Method in javax.jdo.Query void setGrouping (   String  group ) Set the grouping expressions, optionally including a "having" clause. When grouping is specified, each result

PersistenceManagerFactory.addFetchGroups(groups) - JDO Method

JDO Method in javax.jdo.PersistenceManagerFactory void addFetchGroups (   FetchGroup...  groups ) Add the FetchGroup s to the set of active fetch groups . FetchGroup s ... are internally serialized. Parameters: groups - an array of FetchGroups Throws: SecurityExceptionif

PersistenceManagerFactory.removeFetchGroups(groups) - JDO Method

JDO Method in javax.jdo.PersistenceManagerFactory void removeFetchGroups (   FetchGroup...  groups ) Remove the FetchGroup s from the set of active FetchGroup s. Existing FetchGroup s ... , and removeAllFetchGroups are internally serialized. Parameters: groups - an array of FetchGroups Throws

[ODB1] Chapter 6 - Persistent Objects

Explicitly When a new object is constructed by the new operator, it always starts as a transient ... demonstrated by the following code: pm.currentTransaction().begin(); Person person = new Person("George ... transient object. Then it becomes persistent by an explicit call to the makePersistent( ... ) method

[ODB1] Chapter 7 - JDOQL Queries

result = (Collection)query.execute(); Queries are represented by the javax.jdo.Query interface. A Query instance is constructed by one of the PersistenceManager 's newQuery( ... ) methods. For example, in ... . If the query compilation succeeds, the Extent of Person instances in the database is iterated object by

[ODB1] Chapter 5 - JDO Connections

that every connection consumes. Database connections are managed in JDO by the javax.jdo ... management is transparent. The functionality of PersistenceManager instances returned by ... a file, as demonstrated by the following properties file: javax.jdo.PersistenceManagerFactoryClass

JDO Annotations for Fetch Settings

The following annotations are used to define JDO fetch groups and fetch plans:

JDO Annotations

JDO defines dozens of annotations that can be divided into the following groups :

javax.jdo.PersistenceManager

the PersistenceManagerFactory (recommended) or by construction. Since: JDO 1.0 Public Methods void ... throws JDOUserException if the instance is transient or is managed by another PersistenceManager ... and DETACH_UNLOAD_FIELDS) and the active fetch groups determine the scope of fetching for the graph

[ODB1] Chapter 8 - ObjectDB Server

An ObjectDB server can manage one or more databases. Databases that are managed by a server can be accessed by multiple processes simultaneously. In addition, the server supports accessing these databases from remote machines by TCP/IP. More details about client server mode vs. embedded database