ObjectDB Database Search
1-50 of 200 resultsJPA 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 | |
Managing JPA Entities Entities are in-memory instances of entity classes (persistable, user-defined classes) that represent physical objects in the database. Managing an ObjectDB database with JPA requires using entities ... . Entities life cycle The entity life cycle consists of four states: New, Managed, Removed, and Detached | |
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 | |
JPA Shared (L2) Entity Cache Every EntityManager has a persistence context , which is a collection of all the entities that it manages. The persistence context serves as a first-level cache. Retrieving an entity ... a second-level (L2) cache of entities , which is managed by the EntityManagerFactory and shared by | |
Deleting JPA Entities You can delete existing entities from the database either explicitly by calling the remove method or implicitly as a result of a cascade operation. Explicit remove To delete an entity from ... ); em. getTransaction (). commit (); The entity is deleted from 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 | |
Updating JPA Entities Modifying existing entities in the database relies on transparent persistence, which automatically detects and handles changes. Transparent update After an entity is retrieved from the database ... (). commit (); The entity is updated in the database when the transaction is committed | |
Entity Management Settings for the two entity cache mechanisms: The ref attribute specifies the reference type for holding non-dirty entities in the persistence context of the EntityManager , which serves as a first-level cache. The valid values are "weak" , "soft" , and "strong" . Modified entities are always held by strong | |
Chapter 2 - JPA Entity Classes Entity class is a user-defined class whose instances can be stored in a database. To store data in an ObjectDB database by 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.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 | |
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 | |
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 | |
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 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 Primary Key Every entity stored in the database has a primary key. Once assigned, the primary key cannot be modified and represents the entity for as long as it exists in the database. As an object database ... databases. Entity identification Every entity in the database is uniquely identified | |
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 | |
Database Explorer displays a list of bookmarked entities . The Schema window shows the user-defined persistable types ( entity and embeddable classes) in the database and their persistent fields and indexes. The Query ... , either write a query in the Query window or select an element to view (such as an entity class in the Schema | |
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 | |
JPA Optimistic and Pessimistic Locking ObjectDB each entity is locked separately, there is no table locking. Optimistic locking is applied ... . Optimistic Locking ObjectDB maintains a version number for every entity . The initial version of a new entity is 1 when it is first stored in the database. In every transaction where an entity   | |
Paths and Types in JPQL and Criteria API Instances of user-defined persistent classes ( entity classes, mapped superclasses, and embeddable ... entity . The expression uses the capital persistent field in the Country class to navigate to the associated Capital entity . A path expression whose result is a user-defined persistent class | |
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 | |
JPA ORM Mapping Annotations models to relational database schemas. These metadata elements define how entities , attributes ... and schema definitions Use the following annotations to map entities to database tables and define schema-level constraints: Specifies the primary table for an entity . Specifies a secondary table | |
JPA Listeners & Callbacks Annotations during specific entity state transitions. These annotations allow you to define methods within an entity or a listener class. Listeners configuration Entity Entities and mapped superclasses ... listener classes for the entity or mapped superclass. These listeners respond to lifecycle events | |
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 | |
JPA Components Annotations class: Marks the class as an entity . Entities are persistent domain objects with a unique identity ... part of an owning entity and share its identity; they have no persistent identity of their own. Marks ... are inherited by entity subclasses, but the mapped superclass is not persistent on its own. For details | |
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 API retrieve sets of types: // Get all the managed classes: // ( entity classes, embeddable classes, mapped super classes) Set allManagedTypes = metamodel. getManagedTypes (); // Get all the entity classes ... a specific type by its Class instance: // Get a managed type ( entity , embeddable or mapped super classes |