ObjectDB Database Search

1-50 of 200 results

JPA Persistence Unit

A JPA persistence unit is a logical grouping of user-defined persistable classes (entity classes, embeddable classes, and mapped superclasses) and their related settings. Defining a persistence unit ... ;file to define a persistence unit . You can now define a persistence unit entirely in Java code

Step 2: Entity Class and Persistence Unit

with a default persistence unit (that will be configured later). If the  Finish button is disabled ... JPA persistence unit (with default settings) was generated in a persistence .xml file that was added ... ) and selecting New Entity Class ... (or New Other... Persistence Entity Class and clicking Next ). Enter

Step 2: Entity Class and Persistence Unit

file with a default persistence unit (that will be configured later). If the Finish button is disabled ... JPA persistence unit (with default settings) was generated in a persistence .xml file that was added ... ) and selecting  New Entity Class ... (or  New Other... Persistence Entity Class and clicking

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql.Date; import javax. persistence .Entity; import javax. persistence .GeneratedValue; import javax. persistence .Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @GeneratedValue Long id; private

Step 2: Entity Class and Persistence Unit

java.io.Serializable; import java.sql.Date; import javax. persistence .Entity; import javax. persistence .GeneratedValue; import javax. persistence .Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @GeneratedValue Long id

JPA Connections and Transactions

of persistence unit properties as a second parameter: Map properties = new HashMap (); properties ... a persistence unit name as an argument. As an extension, ObjectDB lets you specify a database URL or path directly, bypassing the need for an explicit persistence unit definition. ObjectDB considers any

JPA Core Types

. It allows you to configure the persistence unit without using a traditional persistence .xml file. Entity ... this once during application initialization for each persistence unit (typically for each ObjectDB database ... synchronization with the database. Bootstrapping Configuration Enums Configure persistence unit behavior using

Obtaining a JPA Database Connection

you to define a persistence unit generate an EntityManagerFactory . However, with ObjectDB, you can either define a standard persistence unit or provide the file path of the ObjectDB database directly ... "); The createEntityManagerFactory static method expects a persistence unit name as an argument

JPA Shared (L2) Entity Cache

: Globally in the ObjectDB configuration. Per persistence unit in the persistence .xml file ... value. Persistence Unit Settings You can also enable or disable the shared cache by using a persistence unit property: ... ... You can set the jakarta. persistence .sharedCache.mode property

JPA Class Enhancer

classes -pu : persistence unit name -s : include sub directories in search -d : output path for enhanced ... ): $ java com.objectdb.Enhancer test.X test.pc.* Use the -pu option with the name of a persistence unit to enhance all the managed classes that are defined in that persistence unit : $ java com.objectdb

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 ... class if the given entity belonging to the persistence unit and to an open persistence context

jakarta.persistence.EntityManagerFactory

: AutoCloseable Interface used to interact with the persistence unit , and to create new instances of EntityManager . A persistence unit defines the set of all classes that are related or grouped by ... participate in an association, then they must belong to the same persistence unit . A persistence unit

jakarta.persistence.Persistence

an EntityManagerFactory for the named persistence unit . Parameters: persistenceUnitName - the name of the persistence unit Returns: the factory that creates EntityManager s configured according to the specified persistence unit . Since: Jakarta Persistence (JPA) 1.0 EntityManagerFactory

jakarta.persistence.PersistenceConfiguration

∟ jakarta. persistence .PersistenceConfiguration Represents a configuration of a persistence unit ... to configure a container-managed persistence unit . That is, the configured persistence unit should be considered a Java SE persistence unit , even when this API is used within the Jakarta EE environment

JPA Named Queries

the most relevant one. Because the scope of a named query is the entire persistence unit ... requires you to list managed classes in a persistence unit definition is to support named queries ... the definition of a persistence unit optional. ObjectDB automatically searches for named queries in

Privacy Policy

", "We", "Us" or "Our" in this Agreement) refers to ObjectDB Software Ltd, 109 Vernon House Friar Lane Unit 632 37 Westminster Buildings Theatre Square Nottingham NG1 6LG United Kingdom. Cookies  are small ... section and verifying system and server integrity). Cookies can be " Persistent " or "Session" Cookies

jakarta.persistence.EntityManager

to the associated persistence unit . An application-managed EntityManager may be created ... ; If the persistence unit has resource local transaction management, transactions must be managed using ... not denote an entity type belonging to the persistence unit , or if the second argument is not a valid

JPA Metamodel and Graphs

the persistence unit metadata through the main entry point interface: Serves as the central repository for all managed types within a persistence unit (or an ObjectDB database). It provides methods ... The Jakarta Persistence (JPA) Metamodel API provides a type-safe way to introspect the persistent

JPA Metamodel API

allEmbeddableTypes = metamodel. getEmbeddables (); If managed classes are not listed in the persistence unit ... yet known to ObjectDB (for example, types that are not listed in the persistence unit and have not ... The JPA Metamodel API enables you to examine the persistent object model and retrieve details

JPA Lifecycle Events

listeners are applied automatically to all entities in a persistence unit . You can define default listeners ... unit definition in persistence .xml . To exclude an entity class and its subclasses from using ... is invoked: @PrePersist : Invoked before a new entity is persisted (when persist () is called

Posting Sample Code

( no persistence unit ). Keep the test as simple as possible - remove unnecessary code (but keep it complete ... a persistence unit , An entity or IdClass class should implement the java.io.Serializable interface). ... test; import java.util.*; import jakarta. persistence .*; public final class MyTestCase {   

Storing JPA Entities

.xml , or in another location that is specified in the persistence unit definition in persistence ... Using Jakarta Persistence (JPA) You can store new entities in the database either explicitly by calling the persist method or implicitly through a cascade operation. Explicit persist The following

About Us

persistence solution for Java, based on the Java Persistence API (JPA) and the Java Data Objects (JDO ... Software Ltd Registered in England and Wales. Company No. 07295698. Registered office: Unit 632 37 Westminster Buildings Theatre Square Nottingham NG1 6LG United Kingdom +44 (0) 330 8080702 sales

jakarta.persistence.SchemaManager

persistence unit . Properties are inherited from the EntityManagerFactory ... ( boolean createSchemas ) Create database objects mapped by entities belonging to the persistence unit ... dropSchemas ) Drop database objects mapped by entities belonging to the persistence unit , undoing

JPA Persistable Types

Persistable types are data types that can be used for storing data in the database. ObjectDB supports all JPA persistable types, which include: User-defined classes: Entity classes, mapped ... can be stored directly in the database. Other persistable types can be embedded in entity classes as

JPA Runtime Tuning & Configuration

Most Jakarta Persistence configuration is static, defined through annotations (e.g., @Entity , @Table ) or set globally at the persistence unit level during bootstrapping . This section describes ... ): Defaults passed in a property map to the factory builder or defined in persistence .xml . EntityManager

Setting and Tuning of JPA Queries

most global to most local: For the entire persistence unit , use a persistence .xml property ... query hints: "jakarta. persistence .query.timeout" - Sets the maximum query execution time in milliseconds. A QueryTimeoutException is thrown if the timeout is exceeded. "jakarta. persistence .lock

JPA Optimistic and Pessimistic Locking

several scopes: For the entire persistence unit , use a persistence .xml property: For  ... Jakarta Persistence (JPA) supports both optimistic locking and pessimistic locking . Locking ... , a LockTimeoutException is thrown immediately. The "jakarta. persistence .lock.timeout" hint can be set

JPA Listeners & Callbacks Annotations

Jakarta Persistence (JPA) provides lifecycle callback annotations to trigger custom logic ... (for example, PrePersist and PostLoad ). Specifies that the default listeners defined for the persistence unit are not applied to this class. Specifies that listeners declared in superclasses are not

jakarta.persistence.PersistenceUnit

and its associated persistence unit . Since: Jakarta Persistence (JPA) 1.0 Annotation Elements String name ... (JPA) 1.0 String unitName (Optional) The name of the persistence unit as defined in the persistence .xml file. If specified, the persistence unit for the entity manager factory that is accessible in JNDI

What is the Java Persistence API (JPA)?

The Java Persistence API (JPA) is a standard API for accessing databases from within Java ... JDBC. Using plain old Java objects (POJO) to represent persistent data can significantly simplify ... of the Java Persistence API (JPA). By interacting with ObjectDB using standard JPA

jakarta.persistence.PersistenceContext

Persistence (JPA) 1.0 String unitName (Optional) The name of the persistence unit as defined in the persistence .xml file. If the unitName element is specified, the persistence unit for the entity manager ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .PersistenceContext Implemented

jakarta.persistence.SharedCacheMode

, Serializable Specifies how the provider must use a second-level cache for the persistence unit . Corresponds ... for the persistence unit . Since: Jakarta Persistence (JPA) 1.0 UNSPECIFIED Caching behavior is undefined: provider ... Jakarta Persistence (JPA) Enum jakarta. persistence .SharedCacheMode java.lang.Object ∟ java.lang

CRUD Operations with Jakarta Persistence (JPA)

Explains how to use JPA for CRUD database operations (persist, retrieve, update, remove).

jakarta.persistence.TableGenerator

of the generator name is global to the persistence unit (across all generator types). If no name ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .TableGenerator Implemented ... ; ... } See Also: GeneratedValue Since: Jakarta Persistence (JPA) 1.0 The Auto Generated Values article

jakarta.persistence.Persistence.createEntityManagerFactory(String)

an EntityManagerFactory for the named persistence unit . Parameters: persistenceUnitName - the name of the persistence unit Returns: the factory that creates EntityManager s configured according to the specified persistence unit . Since: Jakarta Persistence (JPA) 1.0 ... Jakarta Persistence (JPA) Method in jakarta. persistence . Persistence EntityManagerFactory

jakarta.persistence.Persistence.createEntityManagerFactory(String,Map)

and return an EntityManagerFactory for the named persistence unit , using the given properties. Parameters: persistenceUnitName - the name of the persistence unit properties - additional properties ... : the factory that creates EntityManager s configured according to the specified persistence unit . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.Persistence.createEntityManagerFactory(PersistenceConfiguration)

an EntityManagerFactory for the named persistence unit , using the given properties. Parameters: configuration - configuration of the persistence unit Returns: the factory that creates EntityManager s configured according to the specified persistence unit . Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.NamedQuery

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedQuery Implemented Interfaces: Annotation Target: Type Declares a named query written in the Jakarta Persistence query language. Query names are scoped to the persistence unit . A named query may be executed by calling EntityManager

Strings in JPQL and Criteria Queries

that navigate to persistent string fields. As the results of predefined JPQL string manipulation functions ... the string argument as an int . For example: LENGTH(' United States') is evaluated to 13 . LENGTH('China

jakarta.persistence.metamodel.Metamodel

Jakarta Persistence (JPA) Interface jakarta. persistence .metamodel.Metamodel Provides access to the metamodel of persistent entities in the persistence unit . Since: Jakarta Persistence (JPA) 2.0 ... . Since: Jakarta Persistence (JPA) 1.0 EntityType entity ( String entityName ) Return the metamodel

jakarta.persistence.NamedNativeQuery

of the result of the native SQL query. Query names are scoped to the persistence unit . A named query ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedNativeQuery Implemented ... class or mapped superclass. See Also: SqlResultSetMapping Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ValidationMode

Jakarta Persistence (JPA) Enum jakarta. persistence .ValidationMode java.lang.Object ∟ java.lang.Enum ∟ jakarta. persistence .ValidationMode Implemented Interfaces: Constable , Comparable , Serializable The validation mode to be used by the provider for the persistence unit . Since: Jakarta Persistence

jakarta.persistence.SequenceGenerator

of the generator name is global to the persistence unit (across all generator types). If no name ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .SequenceGenerator Implemented ... ) Since: Jakarta Persistence (JPA) 1.0 The Auto Generated Values article explains how to use SequenceGenerator

jakarta.persistence.NamedStoredProcedureQuery

to the persistence unit . The procedureName element is the name of the stored procedure in the database ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedStoredProcedureQuery ... StoredProcedureParameter Since: Jakarta Persistence (JPA) 2.1 Annotation Elements String name The name used to refer

jakarta.persistence.NamedEntityGraph

entity. Entity graph names must be unique within the persistence unit . Default: "" Since: Jakarta ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedEntityGraph Implemented ... , and may be passed to EntityManager.find . Since: Jakarta Persistence (JPA) 2.1 Annotation Elements String

jakarta.persistence.Converter

entity in the persistence unit , except for attributes for which conversion is overridden by means ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .Converter Implemented Interfaces ... type parameter of AttributeConverter . If autoApply = true , the persistence provider

jakarta.persistence.NamedQueries

Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedQueries Implemented Interfaces: Annotation Target: Type Declares multiple named Jakarta Persistence query language queries. Query names are scoped to the persistence unit . The NamedQueries annotation can be applied to an entity or

Step 2: Define a JPA Entity Class

class. The warning that NetBeans displays on the Guest class indicates that a persistence unit ... 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

indicates that a persistence unit definition in an XML file is missing. This is discussed in the ObjectDB ... .Serializable; import javax. persistence .*; @Entity public class Point implements Serializable { private