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) with related settings. Defining a persistence unit is optional when using ObjectDB, but required by JPA. persistence .xml Persistence units are defined in

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

Database Connection using JPA

of the createEntityManagerFactory method takes a map of persistence unit properties as a second parameter: Map properties ... an argument a name of a persistence unit . As an extension, ObjectDB enables specifying a database URL (or path) directly, bypassing the need for a persistence unit . Any string that starts with objectdb

Obtaining a JPA Database Connection

to get an EntityManager instance. JPA requires the definition of a persistence unit in an XML file in order ... persistence unit in an XML file or you can simply provide the file path of the ObjectDB database ... :$objectdb/db/points.odb"); The createEntityManagerFactory static method expects a persistence unit name as

Shared (L2) Entity Cache

in the ObjectDB configuration. Per persistence unit in the persistence .xml  file. Per entity ... the cache a positive value has to be specified. Persistence Unit Settings The shared cache can also be enabled or disabled using a persistence unit property:        

JPA Class Enhancer

; :  path to input user classes -pu :  persistence unit name -s :  include sub directories ... 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.Enhancer -pu my-pu The -cp option can be used to specify

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

. But since the scope of named queries is the entire persistence unit , names should be selected ... that JPA requires the listing of managed classes in a persistence unit definition is to support named ... classes must be available. ObjectDB makes the definition of a persistence unit optional. Named queries

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 API

the persistence unit (which is optional when using ObjectDB) then only known managed types are returned ... the persistence unit and have not been used yet). In this case, calling the method introduces ... The JPA Metamodel API provides the ability to examine the persistent object model and retrieve

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 javax. persistence .*; public final class MyTestCase {   

Storing JPA Entity Objects

/orm.xml , or in another location that is specified explicitly in the persistence unit definition ... New entity objects can be stored in the database either explicitly by invoking the persist method or implicitly as a result of a cascade operation. Explicit Persist The following code stores

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

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

Setting and Tuning of JPA Queries

): For the entire persistence unit - using a persistence .xml  property:      ... supports the following query hints: "javax. persistence .query.timeout" - sets maximum query execution time ... . persistence .lock.timeout" - sets maximum waiting time for pessimistic locks, when pessimistic locking

Locking in JPA

;The hint can be set in several scopes: For the entire persistence unit - using a persistence .xml   ... occurs a LockTimeoutException is thrown immediately. The "javax. persistence .lock.timeout"  hint ... ; properties.put("javax. persistence .lock.timeout", 2000);   EntityManagerFactory emf =  

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

JPA Lifecycle Events

explicitly in the persistence unit definition (in persistence .xml ). Default listeners are applied by default ... is invoked: @PrePersist - before a new entity is persisted (added to the EntityManager

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

Strings in JPQL and Criteria Queries

navigation to persistent string fields. as results of predefined JPQL string manipulation functions ... returns the number of characters in the argument string as an int . For example: LENGTH(' United

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

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

jakarta.persistence.NamedNativeQueries

to the persistence unit . The NamedNativeQueries annotation can be applied to an entity or mapped superclass. See Also: NamedNativeQuery Since: Jakarta Persistence (JPA) 1.0 Public Static Fields ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedNativeQueries Implemented

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.NamedStoredProcedureQueries

names are scoped to the persistence unit . The NamedStoredProcedureQueries annotation can be applied to an entity or mapped superclass. See Also: NamedStoredProcedureQuery Since: Jakarta Persistence (JPA ... Jakarta Persistence (JPA) Annotation Type jakarta. persistence .NamedStoredProcedureQueries

jakarta.persistence.PersistenceUnitUtil.isInstance(Object,Class)

belonging to the persistence unit and to an open persistence context is an instance of the given entity ... side effect. Parameters: entityClass - an entity class belonging to the persistence unit entity - entity ... belonging to the persistence unit or if the given class is not an entity class belonging

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

: persistenceUnitName - the name of the persistence unit map - properties for schema generation; these may also contain ... Jakarta Persistence (JPA) Method in jakarta. persistence . Persistence void generateSchema (   ... information is provided or if schema generation otherwise fails.. Since: Jakarta Persistence (JPA) 2.1

jakarta.persistence.PersistenceUnitUtil.getClass(T)

unit and to an open persistence context. This method may, but is not required to, load the given ... to the persistence unit . Throws: IllegalArgumentException - if the given object is not an instance of an entity class belonging to the persistence unit . PersistenceException - if the entity is not associated

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