ObjectDB Database Search

1-50 of 200 results

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 configuration: Annotations for JPA lifecycle event callbacks: Java EE container annotations : Many

JPA Annotations for Relationships

. The four relationship modes are represented by the following annotations : Unlike ORM JPA implementations, ObjectDB does not enforce specifying any of the annotations above. Specifying a relationship annotation enables configuring cascade and fetch policy, using the following enum types: Additional

JPA Annotations for Fields

The way a field of a persistable class is managed by JPA can be set by the following annotations : Additional annotations (and enum) are designated for enum fields: Other additional annotations (and enum) are designated for date and calendar fields: Chapter 2 of the ObjectDB manual explains how to use all the above annotations .

JPA Annotations for Classes

JPA defines three types of persistable classes which are set by the following annotations : Chapter 2 of the ObjectDB manual explains these annotations in detail. Entity and mapped super classes can be further configured by annotations that specify cache preferences and lifecycle event listener

JPA Annotations for JPQL Queries

The following annotations are used to define static named JPA queries: The JPA Named Queries section of the ObjectDB Manual explains and demonstrates how to use these annotations to define named JPQL queries.

JPA Annotations for Value Generation

with an optional GenerationType strategy is specified: The @GeneratedValue annotation can also reference a value generator, which is defined at the class level by using one of the following annotations

JPA Annotations for SQL Queries

The following JPA annotations are designated for SQL queries on relational databases: ObjectDB supports only the preferred JPA query language, JPQL, and silently ignores all the above annotations .

JPA Annotations for Mapping (ORM)

The following JPA annotations and enums are designated for mapping a JPA object model to a relational database, and are not required by ObjectDB: ObjectDB silently ignores all the above annotations .

JPA Annotations for Callback Methods

The following annotations can mark methods as JPA callback methods: The Lifecycle Events section of the ObjectDB Manual explains how to use all these annotations on callback methods and with listener classes.

JPA Annotations for Java EE

The following JPA annotations are in use to integrate JPA into a Java EE application and are managed by the Java EE container:

JPA Annotations for Access Modes

Persistence fields can either be accessed by JPA directly (as fields) or indirectly (as properties and get/set methods). JPA 2 provides an annotation and an enum for setting the access mode: More details are provided in chapter 2 of the ObjectDB manual.

JPA Entity Fields

either the Java transient modifier (which also affects serialization) or the JPA @Transient annotation ... the @Transient annotation ). Storing an entity object in the database does not store methods or code ... ). Every persistent field can be marked with one of the following annotations : OneToOne , ManyToOne

Index Definition

definition uses JDO’s @Index and @Unique annotations to define indexes (JPA's @Index  cannot be applied to fields): import javax.jdo. annotations .Index; import javax.jdo. annotations .Unique ... of the @Index or @Unique annotations : @Entity @Index ( members ={"lastName","firstName"}) public class

JDO Annotations for Index Definition

The following annotations are used to define indexes on persistent fields: The Index Definition section of the ObjectDB manual explains these annotations in details.

JDO Annotations for Mapping (ORM)

The following JDO annotations and enums are designated for mapping a JDO object model to a relational database, and are not required by ObjectDB: ObjectDB silently ignores all the above annotations .

JDO Annotations for Classes

JDO supports two modes of persistable classes that can be set by the following annotations : Non persistable classes that should be enhanced (because of accessing persistent fields of other classes directly) can be marked with: The identity mode of persistence capable classes can be specified by using:

Miscellaneous JDO Annotations

This section contains miscellaneous JDO annotations and associated enum types:

JDO Annotations for Fields

The way a field of a persistable class is managed by JDO can be set by the following annotations and enum types:

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:

JPA Lifecycle Events

, package and private ) but should not be static . The annotation specifies when the callback method ... it with more than one annotation . By default, a callback method in a super entity class is also invoked for entity ... annotation : @Entity @EntityListeners (MyListener.class)     public class

JPA Persistable Types

way to declare a class as an entity is to mark it with the Entity annotation : import javax ... can be set explicitly by using the name attribute of the Entity annotation : @Entity ( name ="MyName ... object. A class is declared as embeddable by marking it with the Embeddable annotation : @Embeddable

Auto Generated Values

Marking a field with the @GeneratedValue annotation specifies that a value will be automatically ... also supports this annotation for non-key numeric persistent fields as well. Several different value generation ... number generator is also used to generate numeric values for primary key fields annotated by

JPA Named Queries

and @NamedQueries Annotations The following  @NamedQuery annotation defines a query ... : @NamedQuery ( name ="Country.findAll", query ="SELECT c FROM Country c") The  @NamedQuery annotation ... for the  setLockMode and  setHint methods. Every  @NamedQuery annotation is attached

JPA Persistence Unit

that are added to the default META-INF/orm.xml mapping file. Every annotation that is described in ... to annotations . Both JPA mapping files and JDO package.jdo files are supported. This manual focuses on using annotations which are more common and usually more convenient. Details on using XML metadata

JPA Primary Key

automatically : } The @Id annotation marks a field as a primary key field. When a primary key field is defined ... ; @GeneratedValue annotation specifies that the primary key is automatically allocated by ObjectDB. Automatic value ... class using the @IdClass annotation . The ID class reflects the primary key fields and its objects

ObjectDB Object Database Features

using XML and annotations . Zero administration. Documentation Compressive, up to date, searchable ... to ObjectDB. Persistence is set using JPA/JDO annotations (e.g. @Entity , @Id , @Index ). Transparent ... Criteria Query API . Static definition ( named queries ) in annotations (@NamedQuery) and XML. Query

Retrieving JPA Entity Objects

FetchType . LAZY in either @OneToOne or @ManyToOne annotations (currently ObjectDB does not distinguish ... annotations (currently ObjectDB does not distinguish between the two) enables cascading retrieval

JPA Class Enhancer

, however, that only classes which are marked as persistable by annotations (e.g. @Entity , @Embeddable ... may only be accessed directly from annotated persistable user classes. Enhancement by a Java agent is very easy

Defining a JPA Entity Class

that is marked ( annotated ) as having the ability to represent objects in the database. Conceptually ... is an ordinary Java class. The only unique JPA addition is the @Entity annotation , which marks the class as

Apache License, Version 2.0, January 2004

, that is based on (or derived from) the Work and for which the editorial revisions, annotations

FROM clause (JPQL / Criteria API)

name annotation element. Multiple range variables are allowed. For example, the following query

Literals in JPQL and Criteria Queries

) but it can be modified by specifying another name explicitly in the @Entity 's name annotation element

JPA Query API

and @NamedQueries annotations . It is considered to be a good practice in JPA to prefer named queries

Deleting JPA Entity Objects

which can be specified using the orphanRemoval element of the @OneToOne and @OneToMany annotations : @Entity

Shared (L2) Entity Cache

class - using annotations . ObjectDB Configuration The shared cache size is specified in the ObjectDB

Step 4: Add a Controller Class

. annotation .Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind. annotation .RequestMapping; import org.springframework.web.servlet.ModelAndView; @Controller ... ); } } The GuestController class is defined as a Spring managed web controller using the @Controller annotation

Step 4: Add a Controller Class

.http.HttpServletRequest; import org.springframework.beans.factory. annotation .Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind. annotation .RequestMapping ... a Spring managed web controller using the @Controller annotation . A GuestDao component

Step 3: Define a Spring DAO Component

.transaction. annotation .Transactional; @Component public class GuestDao { // Injected database ... it into the  em field (because it is annotated with the  @PersistenceContext annotation ). Handles transactions automatically for methods that are annotated with the  @Transactional

Step 3: Define a Spring DAO Component

.springframework.transaction. annotation .Transactional; @Component public class GuestDao { // Injected database ... it into the  em field (because it is annotated with the  @PersistenceContext annotation ). Handles transactions automatically for methods that are annotated with the @Transactional annotation

Step 2: Define a JPA Entity Class

should represent Point objects in the database. Apart from the @Entity annotation and the id field (and its annotations ) - the Point class is an ordinary Java class. The next step is adding to the project

Step 2: Define a JPA Entity Class

objects in the database. Besides the @Entity annotation and the id field (and its annotations

Step 3: Define an EJB Session Bean

(because it is annotated with the  @PersistenceContext annotation ). Handles transactions automatically

Step 2: Define a JPA Entity Class

; The new class should represent Guest objects in the database. Besides the @Entity annotation and the id field (and its annotations ) - the Guest class is an ordinary Java class. The next step is adding

Step 4: Add a Servlet Class

.ejb.EJB; import javax.servlet.ServletException; import javax.servlet. annotation .WebServlet; import ... ; guestDao field automatically (since the field is marked with the  @EJB annotation ). The next step

Step 2: Define a JPA Entity Class

. Besides the @Entity annotation and the id field (and its annotations ) - the Guest class is an ordinary Java

Step 3: Define an EJB Session Bean

(because it is annotated with the @PersistenceContext annotation ). Handles transactions automatically using

Step 4: Add a Servlet Class

; import javax.servlet. annotation .WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet ... annotation ). The next step is adding a JSP page that will serve as the application view and will produce the guestbook output.

Step 6: Set the Spring XML

content: The settings above guides Spring to support annotations (for components, controllers

Step 6: Set the Spring XML

with the following new content: The settings above guides Spring to support annotations (for components