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

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

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

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

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

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:

Miscellaneous JDO Annotations

This section contains miscellaneous JDO annotations and associated enum types:

JDO Annotations

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

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:

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

javax.jdo.annotations.Persistent

JDO Annotation Persistent Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for defining the persistence of a member. This corresponds to the xml elements "field" and "property". Since: JDO 2.1 Public Annotation Attributes String cacheable default "true

javax.jdo.annotations.NotPersistent

JDO Annotation NotPersistent Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation to specify that the member is not persistent. If used, this is the only JDO annotation allowed on a member. This corresponds to the xml attribute persistence-modifier

javax.jdo.annotations.PersistenceAware

JDO Annotation PersistenceAware Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation to specify that the class is persistence-aware. If used, this is the only JDO annotation ... " of the "class" element. Since: JDO 2.1 This annotation is a marker annotation (with no attributes).

javax.jdo.annotations.PersistenceCapable

JDO Annotation PersistenceCapable Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation for whether the class or interface is persistence-capable. Since: JDO 2.1 Public Annotation ... Persistent [] members default {} Member declarations. Annotations for persistent members

javax.jdo.annotations.Columns

JDO Annotation Columns Target: ElementType.FIELD, ElementType.METHOD, ElementType.TYPE Implemented Interfaces: Annotation Annotation for a group of columns. Since: JDO 2.1 Public Annotation Attributes Column [] value default null The columns annotation information. Since: JDO 2.1

javax.jdo.annotations.EmbeddedOnly

JDO Annotation EmbeddedOnly Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation for whether the class is only for persisting embedded into another object. Same as specifying @PersistenceCapable(embeddedOnly="true"). Since: JDO 2.1 This annotation is a marker annotation (with no attributes).

javax.jdo.annotations.ForeignKey

JDO Annotation ForeignKey Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a database foreign-key. Corresponds to the xml element "foreign-key". Since: JDO 2.1 Public Annotation Attributes Column [] columns default {} Columns

javax.jdo.annotations.Index

JDO Annotation Index Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a database index. Used for database schema generation to create indexes. Corresponds to the xml element "index". Since: JDO 2.1 Public Annotation Attributes Column

javax.jdo.annotations.Serialized

JDO Annotation Serialized Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation on a member (field or property) to indicate that the member is stored serialized ... .1 This annotation is a marker annotation (with no attributes).

javax.jdo.annotations.Transactional

JDO Annotation Transactional Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation to indicate that a member (field or property) is transactional but not ... " and "property" elements. Since: JDO 2.1 This annotation is a marker annotation (with no attributes).

javax.jdo.annotations.Unique

JDO Annotation Unique Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a database unique constraint. Used for database schema ... Annotation Attributes Column [] columns default {} Columns that compose this unique constraint

javax.jdo.annotations.Cacheable

JDO Annotation Cacheable Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation to specify that this class/field/property is cacheable in ... " elements. Since: JDO 2.2 Public Annotation Attributes String value default "true" Since: JDO 2.2

javax.jdo.annotations.Column

JDO Annotation Column Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a column in the database. Corresponds to the xml element "column". Since: JDO 2.1 Public Annotation Attributes String allowsNull default "" Whether the column allows null values

javax.jdo.annotations.DatastoreIdentity

JDO Annotation DatastoreIdentity Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation for the datastore identity of the class. Corresponds to the xml element "datastore-identity" of the "class" element. Since: JDO 2.1 Public Annotation Attributes String column default "" Name

javax.jdo.annotations.Discriminator

JDO Annotation Discriminator Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation for the discriminator of the class. Corresponds to the xml element "discriminator" of the "inheritance" element. Since: JDO 2.1 Public Annotation Attributes String column default "" Name

javax.jdo.annotations.Element

JDO Annotation Element Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for the element of a collection/array relation. Corresponds to the xml element "element". Since: JDO 2.1 Public Annotation Attributes String column default "" Name of the column

javax.jdo.annotations.Embedded

JDO Annotation Embedded Target: ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation to define that the object is embedded into the table of the owning object. Corresponds to the xml element "embedded". Since: JDO 2.1 Public Annotation Attributes Persistent

javax.jdo.annotations.Extension

JDO Annotation Extension Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a JDO vendor extension. Corresponds to the xml element "extension". Since: JDO 2.1 Public Annotation Attributes String key default null The key

javax.jdo.annotations.Extensions

JDO Annotation Extensions Target: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD Implemented Interfaces: Annotation Annotation for a group of extensions Since: JDO 2.1 Public Annotation Attributes Extension [] value default null The extensions. Since: JDO 2.1

javax.jdo.annotations.FetchGroup

JDO Annotation FetchGroup Target: ElementType.TYPE Implemented Interfaces: Annotation Annotation for the fetch group of a class. Corresponds to the xml element "fetch-group". Since: JDO 2.1 Public Annotation Attributes String[] fetchGroups default {} Fetch groups to be nested (included) in