Internal Website 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

Database Explorer

. The order of elements in an ordered collection can be modified by using the Edit Move Element commands ... ] 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 clicking

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

javax.persistence.criteria.Order

JPA Interface Order An object that defines an ordering over the query results. Since: JPA 2.0 The ORDER BY clause (JPQL / Criteria API) article explains how to use Order . Public Methods Expression getExpression () Return the expression that is used for ordering . Return: expression used

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 Primary Key

for Object Clustering Entity objects are physically stored in the database ordered by their primary key ... are ordered in the database by their primary key, events of the same sensor during a period of time ... the database is uniquely identified (and can be retrieved from the database) by the combination of its type

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

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

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

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

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

JPA Criteria API Queries

, avg , min , max , ...). ORDER BY clause ( orderBy , Order , asc , desc ). The links above are direct ... , 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

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 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

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

DELETE Queries in JPA/JPQL

BY , HAVING and ORDER BY clauses. A WHERE clause, which is essential for removing selected ... 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

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

ObjectDB 2.9 Developer's Guide

knowledge of database programming (SQL, JDBC, ORM or JPA) is not required in order to follow this guide ... 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.  

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 ... ;the client machine by the server is also required a Keystore file (which might be different from

Order.reverse() - JPA Method

JPA Method in javax.persistence.criteria. Order Order reverse () Switch the ordering . Return: a new Order instance with the reversed ordering Since: JPA 2.0

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

[ODB1] Chapter 7 - JDOQL Queries

; Ordering the Results A result collection can be ordered by a query. For example: Query query = pm ... is returned by the query. Iterating over the result collection using Iterator returns people in order ... the order in which they were added to the database (but this behavior is not specified by JDO

[ODB1] Chapter 6 - Persistent Objects

that is required by JDO, ObjectDB manages another cache containing database pages, in order to improve efficiency ... well using complex, sophisticated queries. The results can also be sorted by specified order expressions ... Explicitly When a new object is constructed by the new operator, it always starts as a transient

[ODB1] Chapter 9 - ObjectDB Explorer

Fields" and the "Hidden Fields" lists. You can change the order of the shown fields by using the Up and Down arrow buttons or the "Field Ordering " combo box. A view for a class can also be set by ... .jar my.odb Some JVM arguments can be useful. For instance, by default Java does not use

[ODB1] Chapter 4 - JDO Metadata

file. The metadata is used first by the JDO Enhancer, and later by the JDO ... description of each class in several .jdo files in a pre defined order . If a metadata description ... the following paths (in the order shown): META-INF/package.jdo WEB-INF/package.jdo package.jdo a/package.jdo

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

[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

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

Query.setOrdering(ordering) - JDO Method

one or more ordering declarations separated by commas. Each ordering declaration is the name of the field on which to order the results followed by one of the following words: " ascending " or " descending ... JDO Method in javax.jdo.Query void setOrdering (   String  ordering ) Set

[ODB1] Chapter 5 - JDO Connections

an automatic lock mechanism in order to prevent a database object from being modified by two different users ... that every connection consumes. Database connections are managed in JDO by the javax.jdo ... management is transparent. The functionality of PersistenceManager instances returned by

[ODB1] Chapter 3 - Persistent Classes

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 ... types above are defined as optional by JDO (arrays and most of the collection classes), but ObjectDB

[ODB1] Chapter 2 - A Quick Tour

, step by step. Both sample programs are contained in ObjectDB's samples directory. 2.1   ... ArrayList list; 18 try { 19 // Retrieve the list from the database by its name: 20 list = (ArrayList ... the database by its name "Hello World" using the getObjectById( ... ) method (line 20

ObjectDB 1.0 Manual

technology by Sun Microsystems. The main purpose of this guide is to familiarise you with ObjectDB ... class is and which types are supported by JDO. Chapter 4 - JDO Metadata Shows how to define JDO ... (SQL, JDBC or JDO) is not required in order to follow this guide, but a strong background

[ODB1] Chapter 1 - About ObjectDB

Compliant ObjectDB is compliant with the JDO (Java Data Objects) standard, developed by Sun ... DB2 and Microsoft SQL Server. In addition, by using JDO you are backed up by a large community ... with relational database concepts and the tables and columns defined for an application in order to perform

javax.jdo.annotations.Order

JDO Annotation Order Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for the ordering component of an ordered container member, such as Java Collections Framework Array and List types and Java native array types. Corresponds to the xml element " order