ObjectDB Database Search
1-50 of 200 resultsJPA 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: | |
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 | |
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 | |
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 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 | |
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 | |
AnnotationRef jakarta.persistence.Entity JPA Annotation Entity Target: TYPE Implemented Interfaces: Annotation Declares that the annotated class is an entity . The annotated entity class must: be a non- final top-level class or static inner ... persistent instance variables. An enum, record, or interface may not be designated as an 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 | |
EntityManager.refresh(entity,options) - JPA Method JPA Method in jakarta.persistence.EntityManager void refresh ( Object entity , RefreshOption... options ) Refresh the state of the given managed entity instance from the database, using the specified plain, overwriting changes made to the entity , if any | |
EntityManager.refresh(entity,lockMode,properties) - JPA Method JPA Method in jakarta.persistence.EntityManager void refresh ( Object entity ... the state of the given managed entity instance from the database, overwriting unflushed changes made to the entity , if any, and obtain the given plain, using the specified properties. This operation | |
EntityManager.refresh(entity,lockMode) - JPA Method JPA Method in jakarta.persistence.EntityManager void refresh ( Object entity , LockModeType lockMode ) Refresh the state of the given managed entity instance from the database, overwriting unflushed changes made to the entity , if any, and obtain the given | |
EntityManager.merge(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager T merge ( T entity ) Merge the state of the given new or detached entity instance into the current persistence context, resulting in ... with the database. Return a managed instance with the same persistent state as the given entity instance | |
EntityManager.detach(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager void detach ( Object entity ) Evict the given managed or removed entity from the persistence context, causing the entity to become immediately detached. Unflushed changes made to the entity , if any, including deletion of the entity | |
EntityManager.persist(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager void persist ( Object entity ) Make a new entity instance managed and persistent, resulting in its insertion in the database when the persistence context is synchronized with the database, or make a removed entity managed, undoing | |
EntityManager.lock(entity,lockMode,options) - JPA Method JPA Method in jakarta.persistence.EntityManager void lock ( Object entity ,  ... an entity instance belonging to the persistence context, obtaining the specified plain, using the specified plain. If a pessimistic lock mode type is specified and the entity contains a version attribute | |
EntityManager.remove(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager void remove ( Object entity ) Mark a managed entity instance as removed, resulting in its deletion from the database when the persistence context is synchronized with the database. This operation cascades to every entity related by | |
PersistenceUnitUtil.isInstance(entity,entityClass) - JPA Method; entity , Class entityClass ) Return true if the given entity belonging to the persistence unit and to an open persistence context is an instance of the given entity class, or false otherwise. This method may, but is not required to, load the given entity by side effect | |
EntityManager.lock(entity,lockMode,properties) - JPA Method JPA Method in jakarta.persistence.EntityManager void lock ( Object entity , LockModeType lockMode, Map properties ) Lock an entity ... properties. If a pessimistic lock mode type is specified and the entity contains a version attribute | |
EntityManager.lock(entity,lockMode) - JPA Method JPA Method in jakarta.persistence.EntityManager void lock ( Object entity , LockModeType lockMode ) Lock an entity instance belonging to the persistence context, obtaining the specified plain. If a pessimistic lock mode type is specified and the entity | |
EntityManager.refresh(entity,properties) - JPA Method JPA Method in jakarta.persistence.EntityManager void refresh ( Object entity , Map properties ) Refresh the state of the given managed entity instance from the database, using the specified properties, and overwriting unflushed changes made to the entity | |
EntityManager.refresh(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager void refresh ( Object entity ) Refresh the state of the given managed entity instance from the database, overwriting unflushed changes made to the entity , if any. This operation cascades to every entity related by an association | |
EntityManager.getReference(entity) - JPA Method JPA Method in jakarta.persistence.EntityManager T getReference ( T entity ) Obtain a reference to an instance of the entity class of the given object, with the same primary key as ... () is called.) This operation allows the application to create an association to an entity without loading | |
PersistenceUnitUtil.getClass(entity) - JPA Method JPA Method in jakarta.persistence.PersistenceUnitUtil Class getClass ( T entity ) Return the concrete entity class if the given entity belonging to the persistence unit and to an open persistence context. This method may, but is not required to, load the given entity by | |
ProviderUtil.isLoadedWithoutReference(entity,attributeName) - JPA Method; Object entity , String attributeName ) If the provider determines that the entity has been provided by itself and that the state of the specified attribute has been loaded, this method returns LoadState.LOADED . If the provider determines that the entity | |
ProviderUtil.isLoaded(entity) - JPA Method; entity ) If the provider determines that the entity has been provided by itself and that the state ... LoadState.LOADED . If the provider determines that the entity has been provided by itself and that not ... . If the provider cannot determine if the entity has been provided by itself, this method returns | |
PersistenceUnitUtil.getIdentifier(entity) - JPA Method entity ) Return the id of the entity . A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id. Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException - if the object is found not to be an entity Since: JPA 2.0 | |
CriteriaDelete.from(entity) - JPA Method entity ) Create and add a query root corresponding to the entity that is the target of the DELETE. A CriteriaDelete object has a single root, the entity that is being deleted. Parameters: entity - metamodel entity representing the entity of type X Return: query root corresponding to the given entity Since: JPA 2.1 | |
PersistenceUnitUtil.isLoaded(entity) - JPA Method; entity ) Determine the load state of an entity belonging to the persistence unit. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded ... to unintended loading of state. Parameters: entity - entity instance whose load state is to be determined | |
PersistenceUnitUtil.load(entity) - JPA Method JPA Method in jakarta.persistence.PersistenceUnitUtil void load ( Object entity ) Load the persistent state of an entity belonging to the persistence unit and to an open persistence context. After this method returns, isLoaded must return true with the given entity instance |