ObjectDB Database Search

1-50 of 200 results

ObjectDB - JPA Object Database for Java

solution. Using a relational database management system (RDBMS) to store and retrieve Java objects requires slow conversions between graphs of Java objects and flat database table rows. Object Relational ... with a database . ObjectDB is an extremely easy to use pure Java Object Database , which supports JPA

Is ObjectDB better than competing object databases?

. However, you should consider the following points when doing your own objective comparison of object databases : ObjectDB is unique in supporting the standard APIs. It is the only object database with built in ... of the Java Data Objects (JDO) API than competing object databases . By using a standard API such as JPA

Obtaining a JPA Database Connection

In JPA, a database connection is represented by the EntityManager interface. Therefore, to manipulate an ObjectDB database , you need an EntityManager instance. Operations that modify database ... that represents the database . Then, you use that factory to get an EntityManager instance. JPA requires

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 fragment stores 1,000 Point objects in the database : em. getTransaction (). begin (); for (int i = 0

Database Schema Evolution

happens automatically in memory each time the entity is loaded. The object in the database is updated to the new schema only when that entity is stored in the database again. An entity is converted ... , as long as the elements are convertible (for example, from int[] to ArrayList ). From any object

Is ObjectDB better than Object Relational Mapping (ORM)?

As noted above, using ObjectDB instead of a relational database and ORM combination  ... of a relational database is mandatory (e.g. as a result of a customer request or when a new application is developed for an existing old relational database ). By using the Java Persistence API (JPA

Database Management Settings

The configuration element specifies back-end ( database engine) settings for the server ... specifies the database file and page size settings: The initial attribute specifies the initial size for each new database file. The resize attribute specifies the size by which to extend the database

Database Replication and Clustering

database is managed on multiple computers, or nodes, which can be in different geographic locations ... . In a master-slave replication model, the master node manages the primary database , which supports ... , read-only copies of the database . Updates to the master database are automatically propagated

Database Doctor

The ObjectDB Doctor tool provides two related services: Diagnose and validate an ObjectDB database file : Checks a specified ObjectDB database file to verify its integrity. If the file is corrupted ... database file : Creates a new database file and copies all recoverable data from the corrupted file

Database Transaction Replayer

tool can apply recorded database operations to a matching database backup, if available. This feature is useful for two purposes: Recovering from a database failure by replaying the recorded ... When recording is enabled , ObjectDB maintains a recording directory for each database file. The name

Retrieving JPA Entities

Jakarta Persistence (JPA) provides various ways to retrieve objects from the database . Retrieving objects does not require an active transaction because it does not change the database content ... the persistence context, JPA constructs a new object and populates it with data from the database or

jakarta.persistence.EntityManager.lock(Object,LockModeType,LockOption...)

; Object entity ,    LockModeType lockMode ,    LockOption... options ) Lock ... the database lock. If these checks fail, the OptimisticLockException is thrown. If the lock mode type ... if the database locking failure causes transaction-level rollback the LockTimeoutException is thrown

jakarta.persistence.EntityManager.lock(Object,LockModeType,Map)

; Object entity ,    LockModeType lockMode ,    Map properties ) Lock an entity ... , the persistence provider must also perform optimistic version checks when obtaining the database ... if the database locking failure causes transaction-level rollback the LockTimeoutException ia thrown

jakarta.persistence.EntityManager.refresh(Object,LockModeType,Map)

; Object entity ,    LockModeType lockMode ,    Map properties ) Refresh the state of the given managed entity instance from the database , overwriting unflushed changes ... is thrown if the database locking failure causes transaction-level rollback the LockTimeoutException

jakarta.persistence.EntityManager.refresh(Object,RefreshOption...)

; Object entity ,    RefreshOption... options ) Refresh the state of the given managed entity instance from the database , using the specified options , overwriting changes made to the entity ... : the PessimisticLockException is thrown if the database locking failure causes transaction-level rollback

jakarta.persistence.EntityManager.refresh(Object,LockModeType)

; 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 PessimisticLockException is thrown if the database locking failure causes transaction-level

jakarta.persistence.EntityManager.lock(Object,LockModeType)

; Object entity ,    LockModeType lockMode ) Lock an entity instance belonging ... checks when obtaining the database lock. If these checks fail, the OptimisticLockException is thrown ... : the PessimisticLockException is thrown if the database locking failure causes transaction-level rollback

jakarta.persistence.PersistenceUnitUtil.load(Object,String)

;  Object entity ,    String attributeName ) Load the persistent value of a given ... instance Throws: IllegalArgumentException - if the given object is not an instance of an entity class ... with an open persistence context or cannot be loaded from the database . Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.PersistenceUnitUtil.load(Object)

;  Object entity ) Load the persistent state of an entity belonging to the persistence unit ... : IllegalArgumentException - if the given object is not an instance of an entity class belonging ... or cannot be loaded from the database . Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.EntityManager.refresh(Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void refresh (    Object entity ) Refresh the state of the given managed entity instance from the database ... : EntityNotFoundException - if the entity no longer exists in the database . IllegalArgumentException

jakarta.persistence.EntityManager.refresh(Object,Map)

; Object entity ,    Map properties ) Refresh the state of the given managed entity instance from the database , using the specified properties, and overwriting unflushed changes ... Throws: EntityNotFoundException - if the entity no longer exists in the database

jakarta.persistence.TypedQuery.setHint(String,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setHint (    String hintName ,    Object value ) Set a query property or hint. The hints elements ... on the database in use and the locking mechanisms used by the provider, this hint may or may not be observed

jakarta.persistence.EntityManager.detach(Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager void detach (    Object entity ) Evict the given managed or removed entity from the persistence context, causing ... deletion of the entity, will never be synchronized to the database . Managed entities which reference

FROM clause (JPQL / Criteria API)

The FROM clause declares query identification variables for iterating over objects in the database ... that iterate over all the database objects of a specific entity class hierarchy, which includes ... the following query, c iterates over all the Country objects in the database : SELECT c FROM Country AS c

Storing JPA Entities

class instance. Only entity class instances can be stored in the database independently. Objects of other persistable types can be stored in the database only as embedded objects in containing ... stored in the database with its Address instance as an embedded object . Note that embedded objects

SELECT clause (JPQL / Criteria API)

, including transparent navigation to other database objects , transparent update detection , support ... query returns Country objects , which then become managed by the EntityManager instance em : TypedQuery ... , the following query returns country names as String instances, rather than Country objects : SELECT

Defining a JPA Entity Class

To store Point objects in a database using JPA, you must define an entity class . A JPA entity ... that it can represent objects in the database . Conceptually, this is similar to serializable classes ... and retrieve Point objects from the database : package com.objectdb.tutorial; import jakarta

JPA Query Structure (JPQL / Criteria)

, which returns only field values from database tables. This makes JPQL more object -oriented ... values). A Minimal JPQL Query The following query retrieves all Country objects from the database ... query variable represents an iteration over objects in the database . A query variable that is bound

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 have limited functionality: Many JPA methods, for example, lock , do not accept detached objects . Retrieval by

JPA Persistable Types

can be stored in the database only as embedded objects , that is, as part of a containing entity. A class ... Persistable types are data types that can be used for storing data in the database . ObjectDB ... can be stored directly in the database . Other persistable types can be embedded in entity classes as

JPA Lifecycle Events

). @PostPersist : Invoked after a new entity is stored in the database (during a commit or flush operation). @PostLoad : Invoked after an entity is retrieved from the database . @PreUpdate : Invoked ... is updated in the database (during a commit or flush operation). @PreRemove : Invoked when an entity

DELETE Queries in JPA/JPQL

to JPA, so you can use the following query to delete all objects in the database : DELETE FROM Object ... 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

WHERE clause (JPQL / Criteria API)

for retrieving a specific subset of objects from the database . How a WHERE clause works The following query ... over all Country objects in the database , using c as the range variable. Before passing these Country objects ... that satisfy the WHERE predicate. For entity classes with millions of objects in the database

JPA Entity Fields

that don't participate in persistence, so their values are never stored in the database ... -persistent) fields and has no data to store in the database . Persistent fields Every non-static non ... the @Transient annotation). Storing an entity in the database stores only its persistent state, not

jakarta.persistence.EntityManager

associated with a persistence context are considered managed objects , with a well-defined lifecycle ... , that is scheduled for removal from the database upon transaction commit. The EntityManager API is used ... that there is no explicit "update" operation; since an entity is a managed object , modifications

What is ObjectDB?

ObjectDB is an Object Oriented Database Management System (ODBMS). It provides all the standard database management services (storage and retrieval, transactions, lock management, query processing ... objects (and graphs of objects ) in an ObjectDB database directly. There's no need to define tables

What is the Java Persistence API (JPA)?

(as classes and objects ). ObjectDB is the only database management system with built in support ... The Java Persistence API (JPA) is a standard API for accessing databases  from within Java applications. The main advantage of JPA over JDBC (the older Java API for interacting with databases

What is the Java Data Objects (JDO)?

The Java Data Objects (JDO) is another standard for accessing persistent data in databases , using ... with both relational and object databases . JDO is supported by many object databases , including ObjectDB, and it is probably the most popular Java API for object databases today.

jakarta.persistence.LockTimeoutException.LockTimeoutException(Object)

Jakarta Persistence (JPA) Constructor in jakarta.persistence.LockTimeoutException LockTimeoutException (    Object entity ) Constructs a new LockTimeoutException exception with the specified object . Parameters: entity - the entity. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.EntityManager.contains(Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManager boolean contains (    Object entity ) Determine if the given object is a managed entity instance belonging to the current persistence context. Parameters: entity - entity instance Returns: boolean value indicating

jakarta.persistence.Cache.evict(Class,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.Cache void evict (    Class cls ,    Object primaryKey ) Remove the data for the given entity from the cache. Parameters: cls - entity class primaryKey - primary key Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.property(String,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceConfiguration PersistenceConfiguration property (    String name ,    Object value ) Set a property of this persistence unit. Parameters: name - the property name value - the property value Returns: this configuration. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceUnitUtil.isLoaded(Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceUnitUtil boolean isLoaded (    Object 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

jakarta.persistence.PersistenceUnitUtil.isLoaded(Object,String)

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceUnitUtil boolean isLoaded (    Object entity ,    String attributeName ) Determine the load state of a given persistent attribute of an entity belonging to the persistence unit. Parameters: attributeName - name

jakarta.persistence.TypedQuery.setParameter(String,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setParameter (    String name ,    Object value ) Bind an argument value to a named parameter. Parameters: name - parameter name value - parameter value Returns: the same query instance. Throws

jakarta.persistence.TypedQuery.setParameter(int,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.TypedQuery TypedQuery setParameter (    int position ,    Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Returns: the same query instance. Throws

jakarta.persistence.OptimisticLockException.OptimisticLockException(Object)

Jakarta Persistence (JPA) Constructor in jakarta.persistence.OptimisticLockException OptimisticLockException (    Object entity ) Constructs a new OptimisticLockException exception with the specified entity. Parameters: entity - the entity. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.StoredProcedureQuery.setParameter(int,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery setParameter (    int position ,    Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Returns: the same query

jakarta.persistence.StoredProcedureQuery.setParameter(String,Object)

Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureQuery StoredProcedureQuery setParameter (    String name ,    Object value ) Bind an argument value to a named parameter. Parameters: name - parameter name value - parameter value Returns: the same query

jakarta.persistence.OptimisticLockException.OptimisticLockException(String,Throwable,Object)

Jakarta Persistence (JPA) Constructor in jakarta.persistence.OptimisticLockException OptimisticLockException (    String message ,    Throwable cause ,    Object entity ) Constructs a new OptimisticLockException exception with the specified detail message, cause