ObjectDB Database Search

1-50 of 200 results

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

ObjectDB Object Database Features

, derived attributes, grouping queries and aggregate queries) which are usually missing from Object Oriented ... . Configurable JPA eager/lazy fetch  and JPA query FETCH JOIN . Configurable JDO fetch groups . Ease ... is set using JPA/JDO annotations (e.g. @Entity , @ Id , @Index ). Transparent activation

JPA Entity Fields

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

Auto Generated Values

value earlier. To minimize round trips to the database server, IDs are allocated in groups ... . This generator creates automatic object IDs for entities that do not have defined primary key ... with @GeneratedValue and use the AUTO strategy: @Entity public class EntityWithAutoId1 { @ Id @GeneratedValue

Group by date / time

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

jakarta.persistence.Id

Jakarta Persistence (JPA) Annotation Type jakarta.persistence. Id Implemented Interfaces ... to which the Id annotation is applied should have one of the following types: any Java primitive type; any ... or field. Example: @ Id public Long getId() { return id ; } See Also: Column GeneratedValue

jakarta.persistence.PersistenceConfiguration.VALIDATION_GROUP_PRE_PERSIST

Jakarta Persistence (JPA) Field in jakarta.persistence.PersistenceConfiguration VALIDATION_ GROUP _PRE_PERSIST Target groups for validation at PrePersist . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.VALIDATION_GROUP_PRE_UPDATE

Jakarta Persistence (JPA) Field in jakarta.persistence.PersistenceConfiguration VALIDATION_ GROUP _PRE_UPDATE Target groups for validation at PreUpdate . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.VALIDATION_GROUP_PRE_REMOVE

Jakarta Persistence (JPA) Field in jakarta.persistence.PersistenceConfiguration VALIDATION_ GROUP _PRE_REMOVE Target groups for validation at PreRemove . Since: Jakarta Persistence (JPA) 1.0

On ensuring ID available after persist

the SEQUENCE or  TABLE  strategies, which support allocating a group of IDs in advance in ... , which relies on an "external" entity object having a non-null id after it has been passed ... up to another element) I am using the following for the ID : @ Id //@GeneratedValue(strategy = GenerationType.AUTO

ORDER BY clause (JPQL / Criteria API)

Grouping ( GROUP BY) order The ORDER BY clause is always the last clause in the query processing chain. If a query contains both a GROUP BY clause and an ORDER BY clause, the GROUP BY clause first aggregates the results into groups . The ORDER BY clause then sorts these groups . For example: SELECT c

JPA Primary Key

, ObjectDB supports implicit object IDs , so an explicit primary key is not required. However, ObjectDB ... value by declaring a primary key field: @Entity public class Project { @ Id @GeneratedValue long id ; // still set automatically : } The @ Id annotation marks a field as a primary key field

JPA Query Structure (JPQL / Criteria)

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

Paths and Types in JPQL and Criteria API

. This is an aggregate query with no GROUP BY clause, so all the objects are considered as one group ... expressions in the preceding code can be divided into two main groups : FROM variable expressions

SQL Queries Annotations

dialect. Groups multiple @NamedNativeQuery definitions on a single class. Result set mapping Map ... how the result set of a native query maps to entities, scalar values, or constructor results. Groups

jakarta.persistence.criteria.Subquery

() Return a list of the grouping expressions. Returns empty list if no grouping expressions ... : the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate getGroupRestriction () Return the predicate that corresponds to the restriction(s) over the grouping items, or null

jakarta.persistence.criteria.AbstractQuery

(JPA) 1.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. Returns: the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate

jakarta.persistence.criteria.CriteriaQuery

getGroupList () Return a list of the grouping expressions. Returns empty list if no grouping ... AbstractQuery Returns: the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate getGroupRestriction () Return the predicate that corresponds to the restriction(s) over the grouping items

jakarta.persistence.ConstructorResult

" + "WHERE o.cid = c. id " + " GROUP BY c. id , c.name", "CustomerDetailsResult"); @SqlResultSetMapping( name ... is retrieved for the constructed object. Example: Query q = em.createNativeQuery( "SELECT c. id , c.name ... , columns = { @ColumnResult(name = " id "), @ColumnResult(name = "name"), @ColumnResult(name

JPA Named Queries Annotations

. A container annotation that groups multiple @NamedQuery definitions on a single class. Supplies parameters

FROM clause (JPQL / Criteria API)

, FETCH,FROM, GROUP , HAVING, IN, INDEX, INNER, IS, JOIN, KEY, LEADING, LEFT, LENGTH, LIKE,LOCATE

JPA Query Expressions (JPQL / Criteria)

JPQL and criteria queries are built on query expressions. Every query consists of clauses , such as SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY . Each clause is composed of JPQL or Criteria API expressions. Atomic expressions The atomic query expressions are: JPQL / Criteria Variables

JPA Extended API Reference Guide

Jakarta Persistence API (JPA) 3.2 documentation, generated from the official JavaDoc and enriched with practical notes. It groups the API types into logical sections to help you locate core concepts, query facilities, metamodel details, configuration options, annotations, and exception information

DELETE Queries in JPA/JPQL

cannot include multiple variables, JOIN clauses, or the GROUP BY , HAVING , and ORDER BY clauses

JPA Criteria Queries

to define SELECT, WHERE , GROUP BY , and ORDER BY clauses. To execute the query, pass the instance

JPA Fetch Graphs Annotations

plan. A container annotation used to group multiple @NamedEntityGraph definitions on a single entity

Comparison in JPQL and Criteria API

between any two values that belong to the same group listed above. For example, a double

UPDATE SET Queries in JPA/JPQL

. However, they do not support the GROUP BY , HAVING , and ORDER BY clauses. For example, the following

JPA Criteria API Queries

, multiselect , array , tuple , construct ) FROM clause ( from , join , fetch ) WHERE clause ( where ) GROUP

JPA Persistence Unit

A JPA persistence unit is a logical grouping of user-defined persistable classes (entity classes, embeddable classes, and mapped superclasses) and their related settings. Defining a persistence unit is optional when using ObjectDB but required by JPA. Programmatic configuration

Chapter 4 - JPA Queries (JPQL / Criteria)

clauses: SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY : The next section explains

JPA Metamodel API

type: IdentifiableType superType = entityType. getSupertype (); // Checks if the type has a single ID attribute: boolean hasSingleId = entityType. hasSingleIdAttribute (); // Gets a single ID attribute - including inherited: SingularAttribute id1 = entityType. getId (Long.class); // Gets a single ID

jakarta.persistence.JoinColumns

groups JoinColumn annotations for the same relationship. Each JoinColumn annotation must explicit ... = "ADDR_ ID ", referencedColumnName = " ID "), @JoinColumn(name = "ADDR_ZIP", referencedColumnName = "ZIP

jakarta.persistence.PrimaryKeyJoinColumns

Interfaces: Annotation Target: Type, Method, Field Groups PrimaryKeyJoinColumn annotations. It is used ... ") @DiscriminatorValue("VCUST") @PrimaryKeyJoinColumns({ @PrimaryKeyJoinColumn(name = "CUST_ ID ", referencedColumnName = " ID "), @PrimaryKeyJoinColumn(name = "CUST_TYPE", referencedColumnName = "TYPE

Database Transaction Replayer

of a specific transaction. The transaction ID is used as the file name. A recording file, which has the same transaction ID in its name, contains the database operations that were recorded ... .objectdb.Replayer my.odb 1000 When you specify a transaction ID as a second argument, the Replayer

jakarta.persistence.PersistenceConfiguration

.ValidatorFactory , Since: Jakarta Persistence (JPA) 1.0 VALIDATION_ GROUP _PRE_PERSIST Target groups for validation at PrePersist . Since: Jakarta Persistence (JPA) 1.0 VALIDATION_ GROUP _PRE_REMOVE Target groups for validation at PreRemove . Since: Jakarta Persistence (JPA) 1.0 VALIDATION_ GROUP _PRE_UPDATE Target

Step 1: Create a Maven Web Project

Next . Enter Group Id (e.g.  Guestbook ), Artifact Id (e.g.  Guestbook ), Version (e.g

Schema Update

The configuration element supports renaming packages, classes, and fields in ObjectDB databases. This is a complementary operation to renaming or moving these elements in your IDE during source code ... classes that have been renamed or moved in the IDE without a matching schema configuration, ObjectDB

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

Step 1: Install BIRT and ObjectDB Driver

of the Eclipse IDE that includes BIRT built in. This option may be useful if you are not using the Eclipse IDE for Java EE Developers. Update your existing Eclipse IDE for Java EE Developers environment by installing the BIRT plugins  using the Eclipse Update Manager (updating Eclipse IDE

Step 2: Define a JPA Entity Class

Serializable { private static final long serialVersionUID = 1L; @ Id @GeneratedValue private long id ... Long getId() { return id ; } public int getX() { return x; } public int getY() { return y; } @Override ... should represent Point objects in the database. Apart from the @Entity annotation and the id field

Step 2: Define a JPA Entity Class

static final long serialVersionUID = 1L; @ Id @GeneratedValue private long id ; private int x; private ... () { return id ; } public int getX() { return x; } public int getY() { return y; } @Override public String ... objects in the database. Besides the @Entity annotation and the id field (and its annotations

Step 2: Define a JPA Entity Class

.GeneratedValue; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id ; private ... and the id field (and its annotations) - the Guest class is an ordinary Java class. The next step is adding

Step 2: Define a JPA Entity Class

; import javax.persistence.GeneratedValue; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id ; private String name; private Date signingDate; // Constructors: public

Step 2: Entity Class and Persistence Unit

.GeneratedValue; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id ; private

Getting Started with JPA and Eclipse

. For this tutorial, besides the Java JDK (8 or above) and the Eclipse IDE (either Eclipse IDE for Java EE Developers or Eclipse IDE for Java Developers), you only need to download and extract the ObjectDB

Step 2: Entity Class and Persistence Unit

; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id ; private String

Step 2: Entity Class and Persistence Unit

.GeneratedValue; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id

Step 2: Entity Class and Persistence Unit

.GeneratedValue; import javax.persistence. Id ; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @ Id @GeneratedValue Long id ; private String

JPA Web App Tutorial - Maven Project

/Guestbook/ You may also open and run the Maven project in your IDE : NetBeans IDE and IntelliJ IDEA have built in Maven support.