ObjectDB Database Search

1-50 of 200 results

JPA Entity Fields

The 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 be used only in entity classes. Primary key

Retrieving JPA Entities

. The persistence context serves as a cache for retrieved entities . If a requested entity is not in ... the Level 2 (L2) cache, if enabled. JPA then adds the new entity to the persistence context as a managed entity and returns it to the application. The construction of a new managed object during retrieval

Detached JPA Entities

Detached entities are objects in a special state where they are not managed by an EntityManager but still represent objects in the database. Compared to managed entities , detached objects ... that were loaded before the object was detached. Changes to detached entities are not persisted

Storing JPA Entities

Using Jakarta Persistence (JPA) You can store new entities in the database either explicitly by ... code stores an Employee entity class instance in the database: Employee employee = new Employee ... , and changes its state to Managed. The new entity is stored in the database when the transaction

Defining a JPA Entity Class

To store Point objects in a database using JPA, you must define an entity class . A JPA entity ... , which are marked to indicate that they can be serialized. The Point entity class The following Point class represents points in a plane. It is marked as an entity class, which enables you to store

Chapter 2 - JPA Entity Classes

An entity class is a user-defined class whose instances can be stored in a database. To store data in an ObjectDB database using Jakarta Persistence (JPA), you define entity classes that represent your application's data object model. 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.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

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.PessimisticLockException.entity

Jakarta Persistence (JPA) Field in jakarta.persistence.PessimisticLockException 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: 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

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

JPA Lifecycle Events

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

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

SELECT clause (JPQL / Criteria API)

The ability to retrieve managed entities is a key advantage of JPQL. For example, the following ... . getResultList (); Because the results are managed entities they have all the support that JPA provides ... for deletion , and so on. Query results are not limited to entities . You can use almost any valid JPQL

Index Definition

Querying without indexes requires sequential iteration over entities in the database. If many entities must be examined, this process can take a significant amount of time. Using indexes avoids ... which fields to index carefully. Single-field index The following entity definition uses JDO's

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

literals (for example, 'abc' ), enum literals (for example, mypackage.MyEnum.MY_VALUE ), and entity ... } 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 how java.lang.Class instances represent Java

Database Schema Evolution

Modifications to entity classes that do not change their persistent field definitions ... to the persistent fields of an entity class. New entities must be stored using the new class schema, and old entities , which were stored using the old class schema, must be converted to the new schema. Note

Auto Generated Values

. 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 ... definition is equivalent: @ Entity public class EntityWithAutoId2 { @Id @GeneratedValue long id

JPA Core Types

engine and performing CRUD operations in ObjectDB. These interfaces and classes manage the entity ... . It allows you to configure the persistence unit without using a traditional persistence.xml file. Entity Lifecycle Management Manage database connections and entity lifecycles with these interfaces

JPA Named Queries

methods. Each @NamedQuery annotation is attached to exactly one entity class or mapped superclass, usually ... , you should choose names carefully to avoid collisions, for example, by using the unique entity name as a prefix. For example, you can add the preceding @NamedQuery to the Country entity class: @ Entity

DELETE Queries in JPA/JPQL

As explained in Chapter 2 , you can delete entities from the database by following these steps: Retrieve the entities into an EntityManager . Remove these objects from the EntityManager ... an alternative way to delete entities . Unlike SELECT queries, which retrieve data from the database

JPA Metamodel Types

defining the high-level classification of a type: BASIC , ENTITY , EMBEDDABLE , or MAPPED_SUPERCLASS ... state through attributes form the core of the metamodel: The common superinterface for entities ... with a persistent identity (primary key), serving as the superinterface of entities and mapped

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)

that iterate over all the database objects of a specific entity class hierarchy, which includes an entity class and all its descendant entity classes. Identification variables are always polymorphic ... By default, the name of an entity class in a JPQL query is the unqualified name of the class

JPA Attributes Annotations

Jakarta Persistence (JPA) annotations define how entity attributes (fields and properties ... . The embedded state is stored in the same table as the owning entity . Specifies a collection field or ... " relationships where the target is not an entity . Specifies that the field or property is not persistent

JPA Query Structure (JPQL / Criteria)

operates on Java classes and objects. For example, a JPQL query can retrieve entities , unlike SQL ... ). The exceptions, where JPQL is case-sensitive, include Java source elements such as the names of entity classes ... to an entity class is called a range variable. Range variables define an iteration over all the database

JPA Class Enhancer

the bytecode of compiled classes. Enhancement applies mainly to user-defined persistable classes ( entity ... of persistent field modifications, which avoids the need for snapshot comparison of entities (as ... whenever a persistent field is modified. Enhanced code enables lazy loading of entities

SQL Queries Annotations

the results of native SQL queries to entities or scalar values using these annotations: Defines how the result set of a native query maps to entities , scalar values, or constructor results. Groups ... to entity fields or scalar types with these detailed annotations: Maps a native query result to a specific

jakarta.persistence.EntityGraph

of the root entity . Super Interfaces: Graph This type represents the root of an entity graph that will be used as a template to define the attribute nodes and boundaries of a graph of entities and entity relationships. The root must be an entity type. The methods to add subgraphs implicitly create

Database Management Settings

is defined in the entity class. Some ORM JPA providers require a version field. You can disable ... index is defined for an existing entity class that already has instances stored in the database ... parameter . The elements To remove the ObjectDB evaluation restrictions (a limit of 10 entity classes

JPA Fetch Plan Graphs

Jakarta Persistence (JPA) Entity Graphs optimize query performance by specifying  ... for defining fetch plans of related entities or embeddables. It enables fine-grained control over deep attribute loading within the object hierarchy. The common super-interface for both entity and subgraphs

JPA Metamodel and Graphs

object model at runtime. It allows developers to programmatically examine entities , embeddables ... to retrieve entity and attribute information by class or name, similar to the reflection API in Java ... , described in the following subsections: Describes the hierarchy of persistent types, including entities

jakarta.persistence.EntityManagerFactory

the application, and which must be colocated in their mapping to a single database. If two entity types ... of the Persistence class: if the persistence unit is defined in persistence.xml , an entity manager ... .createEntityManagerFactory , or if the persistence unit was defined using PersistenceConfiguration , an entity

Setting and Tuning of JPA Queries

) ObjectDB uses automatic optimistic locking to prevent concurrent changes to entities by multiple users ... ) or "LAZY" . When LAZY is used, result entities are returned as references with no content. This mode can be useful when the shared L2 cache is enabled and entities might already be available in

JPA Extended API Reference Guide

the fundamental classes and interfaces for entity management and persistence operations. Covers the query API ... for representing the persistent object model. Use these interfaces to inspect entity structures ... model and entity behavior. Documents the exception hierarchy thrown by JPA to indicate errors

CRUD Database Operations with JPA

Given an EntityManager instance, em , which manages the persistence context for the database, you can use it to store, retrieve, update, and delete objects. Storing new entities The following code ... ; i = 100) { em. remove (p); // delete entity } else { p.setX(p.getX() + 100); // update entity

jakarta.persistence.Graph

is not an attribute of this entity .. Since: Jakarta Persistence (JPA) 3.2 AttributeNode ... nodes to the entity graph. If there is already an existing node for one of the given attribute names ... to the entity graph. If there is already an existing node for one of the given attributes, that particular

Eclipse/JPA Spring MVC Web Tutorial

that has signed the guestbook is represented by a  Guest JPA entity and all the  Guest entities

Spring MVC and JPA Tutorial

that has signed the guestbook is represented as Guest JPA entity , and all Guest entities are stored in

Step 4: Add a Servlet Class

the next tutorial step) - a new Guest entity is constructed and stored in the database. All the Guest entities