ObjectDB Database Search

1-50 of 200 results

JPA Entity Fields

Fields of persistable user defined classes ( entity classes, embeddable classes and mapped ... , persistent and inverse fields) can be used in both entity classes and embeddable classes . However, the last two groups (primary key and version fields) can only be used in entity classes. Primary key fields

Retrieving JPA Entity Objects

of the database. The persistence context serves as a cache of retrieved entity objects. If a requested entity object is not found in the persistence context a new object is constructed and filled with data that is retrieved from the database (or from the L2 cache - if enabled). The new entity object

Working with JPA Entity Objects

Entity objects are in-memory instances of entity classes (persistable user defined classes ... requires using entity objects for many operations, including storing, retrieving, updating and deleting database objects. Entity Object Life Cycle The life cycle of entity objects consists of four states

Detached Entity Objects

Detached entity objects are objects in a special state in which they are not managed by any EntityManager but still represent objects in the database. Compared to managed entity objects, detached ... that have been loaded before detachment should be used. Changes to detached entity objects are not stored in

Storing JPA Entity Objects

New entity objects can be stored in the database either explicitly by invoking the persist method ... an instance of the Employee entity class in the database: Employee employee = new Employee("Samuel ... its state to Managed. The new entity object is stored in the database when the transaction

Shared (L2) Entity Cache

Every EntityManager owns a persistence context , which is a collection of all the entity objects ... an entity object that is already managed by the  EntityManager returns the existing instance from the persistence context, rather than a newly instantiated entity object. The scope of the persistence

Defining a JPA Entity Class

To be able to store Point objects in the database using JPA we need to define an entity class . A JPA entity class is a POJO (Plain Old Java Object) class, i.e. an ordinary Java class ... Entity Class The following Point class, which represents points in the plane, is marked as an entity

Deleting JPA Entity Objects

Existing entity objects can be deleted from the database either explicitly by invoking the remove ... ); em. getTransaction (). begin (); em. remove (employee); em. getTransaction (). commit (); The entity ... that are contained in the entity object are also deleted. If the transaction is rolled back and not

Updating JPA Entity Objects

Modifying existing entity objects that are stored in the database is based on transparent ... Once an entity object is retrieved from the database (no matter which way) it can simply be modified in memory ... (); The entity object is physically updated in the database when the transaction is committed

Entity Management Settings

The element specifies settings of the two cache mechanisms for entities : The ref attribute specifies the reference type for holding non dirty entities in the persistence context of the EntityManager ... entities are always held by strong references in the persistence context (until commit or flush

Chapter 2 - JPA Entity Classes

JPA Entity  classes are user defined classes whose instances can be stored in a database. To store data in an ObjectDB database using JPA you have to define entity classes that represent your application data object model. This chapter explains how to define and use entity classes.  This chapter contains the following sections:

jakarta.persistence.Entity

Jakarta Persistence (JPA) Annotation Type jakarta.persistence. Entity Implemented Interfaces: Annotation Target: Type Declares that the annotated class is an entity . The annotated entity class ... interface may not be designated as an entity . An entity has a primary table, mapped using the Table

jakarta.persistence.metamodel.Metamodel.entity(String)

Jakarta Persistence (JPA) Method in jakarta.persistence.metamodel.Metamodel EntityType entity (    String entityName ) Return the metamodel entity type representing the entity . Parameters: entityName - the name of the represented entity Returns: the metamodel entity type. Throws

jakarta.persistence.metamodel.Metamodel.entity(Class)

Jakarta Persistence (JPA) Method in jakarta.persistence.metamodel.Metamodel EntityType entity (    Class cls ) Return the metamodel entity type representing the entity . Parameters: cls - the type of the represented entity Returns: the metamodel entity type. Throws

jakarta.persistence.Entity.name

Jakarta Persistence (JPA) Method in jakarta.persistence. Entity String name (Optional) The entity name. Defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal in the Jakarta Persistence query language. Default: "" Since: Jakarta Persistence (JPA) 1.0

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Open the [New Entity Class] dialog box, e.g. by right clicking the project node (in the [Projects] window) and selecting New Entity Class ... (or New Other... Persistence Entity Class and clicking Next ). Enter

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Open the [New Entity Class] dialog box, e.g. by right clicking the project node (in the [Projects] window) and selecting  New Entity Class ... (or  New Other... Persistence Entity Class and clicking

jakarta.persistence.metamodel.Type.PersistenceType.ENTITY

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence.metamodel.Type.PersistenceType ENTITY Entity class Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.metamodel.Bindable.BindableType.ENTITY_TYPE

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence.metamodel.Bindable.BindableType ENTITY _TYPE Entity type. See Also: EntityType Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.NamedNativeQuery.entities

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedNativeQuery EntityResult[] entities Specifies the result set mapping to entities . May not be used in combination with NamedNativeQuery.resultSetMapping . Default: {} Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.SqlResultSetMapping.entities

Jakarta Persistence (JPA) Method in jakarta.persistence.SqlResultSetMapping EntityResult[] entities Specifies the result set mapping to entities . Default: {} Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PessimisticLockException.entity

Jakarta Persistence (JPA) Field in jakarta.persistence.PessimisticLockException entity Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.LockTimeoutException.entity

Jakarta Persistence (JPA) Field in jakarta.persistence.LockTimeoutException entity Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.OptimisticLockException.entity

Jakarta Persistence (JPA) Field in jakarta.persistence.OptimisticLockException entity Since: Jakarta Persistence (JPA) 1.0

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Right click ...   Finish to create the new entity class. A new class that should represent  Guest objects in ... java.io.Serializable; import java.sql.Date; import javax.persistence. Entity ; import javax.persistence

Step 2: Entity Class and Persistence Unit

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... .Serializable; import java.sql.Date; import javax.persistence. Entity ; import javax.persistence.GeneratedValue; import javax.persistence.Id; @ Entity public class Guest implements Serializable { private

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... .Serializable; import javax.persistence.*; @ Entity public class Point implements Serializable { private ... objects in the database. Besides the @ Entity annotation and the id field (and its annotations

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... code: package guest; import java.io.Serializable; import java.sql.Date; import javax.persistence. Entity ; import javax.persistence.GeneratedValue; import javax.persistence.Id; @ Entity public class Guest

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Right click ... ; import java.io.Serializable; import javax.persistence.*; @ Entity public class Point implements ... should represent Point objects in the database. Apart from the @ Entity annotation and the id field

Step 2: Define a JPA Entity Class

To store objects in an ObjectDB database using JPA we need to define an entity class: Open ... .Serializable; import java.sql.Date; import javax.persistence. Entity ; import javax.persistence.GeneratedValue; import javax.persistence.Id; @ Entity public class Guest implements Serializable { private

JPA Persistable Types

. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes ... types and Serializable types (user or system defined). Note : Only instances of entity classes can be stored in the database directly. Other persistable types can be embedded in entity classes as fields

JPA Lifecycle Events

Callback methods are user defined methods that are attached to entity lifecycle events ... methods are methods that are defined within an entity class. For example, the following entity class defines all the supported callback methods with empty implementations: @ Entity public static class

JPA Primary Key

Every entity object that is stored in the database has a primary key. Once assigned, the primary key cannot be modified. It represents the entity object as long as it exists in the database. As ... that is absent from other object oriented databases. Entity Identification Every entity object in

jakarta.persistence.EntityManager

must be obtained from an EntityManagerFactory , and is only able to manage persistence of entities belonging ... -managed entity manager @PersistenceContext(unitName="orderMgt") EntityManager entityManager ... . A persistence context is a set of entity instances in which for any given persistent entity identity

Database Explorer

of bookmarked entity objects. The [Schema] window shows the user defined persistable types ( entity ... ] tabbed window or select an element for viewing (an entity class in the [Schema] tabbed window ... ). An entity object can be specified by type and primary key separated by # (e.g. Point#1). A collection

SELECT clause (JPQL / Criteria API)

The ability to retrieve managed entity objects is a major advantage of JPQL. For example ... (); Because the results are managed entity objects they have all the support that JPA provides for managed entity objects, including transparent navigation to other database objects, transparent update

Index Definition

Querying without indexes requires iteration over entity objects in the database one by one. This may take a significant amount of time if many entity objects have to be examined. Using proper ... which fields to define with indexes should be done carefully. Single Field Index The following entity

Database Schema Evolution

Modifications to entity classes that do not change their persistent field definitions ... of an entity class are detected by ObjectDB. New entity objects have to be stored in the new class schema, and old entity objects, which were stored previously in the old class schema

Paths and Types in JPQL and Criteria API

Instances of user defined persistable classes ( entity classes, mapped super classes and embeddable ... and values. For example - c.capital , where c represents a Country entity object uses the capital persistent field in the Country class to navigate to the associated Capital entity object. Path expression

Locking in JPA

, if they happen, are detected earlier. Optimistic Locking ObjectDB maintains a version number for every entity object. The initial version of a new entity object (when it is stored in the database for the first time) is 1. In every transaction in which an entity object is modified its version number

Apache License, Version 2.0, January 2004

of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity " shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity

Literals in JPQL and Criteria Queries

(e.g. 'abc' ), enum literals (e.g. mypackage.MyEnum.MY_VALUE ) and entity type literals (e.g. Country ... { RED, GREEN, BLUE } Then example.ui.Color.RED is a valid literal in JPQL, but Color.RED is not. Entity Type Literals Entity type literals represent entity types in JPQL, similar to the way that java

UPDATE SET Queries in JPA/JPQL

Existing entity objects can be updated, as explained in chapter 2 , by: Retrieving the entity objects into an EntityManager . Updating the relevant entity object fields  ... provide an alternative way of updating entity objects. Unlike SELECT queries, which are used

Auto Generated Values

for entity objects with no primary key fields defined (as explained in the previous section ). The same ... @GeneratedValue with the AUTO strategy: @ Entity public class EntityWithAutoId1 { @Id @GeneratedValue ... definition is equivalent: @ Entity public class EntityWithAutoId2 { @Id @GeneratedValue long id

JPA Named Queries

to exactly one  entity class or mapped superclass - usually to the most relevant entity class ... carefully to avoid collision (e.g. by using the unique entity name as a prefix). It makes sense to add the above  @NamedQuery to the Country entity class: @ Entity @NamedQuery ( name ="Country.findAll

DELETE Queries in JPA/JPQL

As explained in chapter 2 , entity objects can be deleted from the database by: Retrieving the entity objects into an EntityManager . Removing these objects from the EntityManager   ... DELETE queries provide an alternative way for deleting entity objects. Unlike SELECT queries

JPA Metamodel API

. Three methods can be used to retrieve sets of types: // Get all the managed classes: // ( entity classes ... (); // Get all the entity classes: Set allEntityTypes = metamodel. getEntities (); // Get all the embeddable ... methods can be used to retrieve a specific type by its Class instance: // Get a managed type ( entity

ObjectDB Object Database Features

). Up to 2,147,483,648 entity classes per database file. Up to 2,147,483,648 indices per database file. Up to 9,223,372,036,854,775,808 entity objects per database file. Unlimited database connections ... . Configurable - minimum/maximum connections and timeout. Caching L1 entity object cache

jakarta.persistence.PersistenceUnitUtil

the persistence unit. The methods of this interface should only be invoked on entity instances obtained from or managed by entity managers for this persistence unit or on new entity instances. Since: Jakarta Persistence (JPA) 2.0 Public Instance Methods Class getClass ( T entity ) Return the concrete entity

FROM clause (JPQL / Criteria API)

are query identification variables that iterate over all the database objects of a specific entity class hierarchy (i.e. an entity class and all its descendant entity classes). Identification variables ... of an entity class in a JPQL query is the unqualified name of the class (e.g. just Country with no package