ObjectDB Database Search

1-50 of 200 results

Database Connection using JPA

of an EntityManagerFactory instance is to support instantiation of EntityManager instances. An EntityManagerFactory is constructed for a specific database, and by managing resources efficiently (e.g ... for that database. The instantiation of the EntityManagerFactory itself might be less efficient

InterfaceRef jakarta.persistence.EntityManagerFactory

JPA Interface EntityManagerFactory Super Interfaces: AutoCloseable Interface used to interact ... programmatically via the EntityTransaction interface. An EntityManagerFactory with a lifecycle managed by ... Persistence.createEntityManagerFactory . Usually, there is exactly one EntityManagerFactory for each

EntityManagerFactory objects being locked during EntityManager creation

wherein the EntityManagerFactory objects are being locked during EntityManager object creation.  Please refer ... to understand any underlying EntityManagerFactory locking mechanism to get deeper insight into ... with ObjectDB wherein the EntityManagerFactory objects are being locked during EntityManager object

EntityManagerFactory.unwrap(cls) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory T unwrap (   Class  cls ... implementation of EntityManagerFactory does not support the given type, the PersistenceException ... class implementing {@code EntityManagerFactory } or an interface it implements. Return: an instance

EntityManagerFactory.addNamedEntityGraph(graphName,entityGraph) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory void addNamedEntityGraph (   String graphName,     EntityGraph  entityGraph ) Add a named copy of the given EntityGraph to this EntityManagerFactory . If an entity graph with the given name already exists

EntityManagerFactory.close() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory void close () Close the factory, releasing any resources that it holds. After a factory instance has been closed, all methods invoked ... . Once an EntityManagerFactory has been closed, all its entity managers are considered to be in the closed state. Throws

EntityManagerFactory.isOpen() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory boolean isOpen () Indicates whether the factory is open. Returns true until the factory has been closed. Return: boolean indicating whether the factory is open Since: JPA 1.0

EntityManagerFactory.getMetamodel() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory Metamodel getMetamodel () Return an instance of the Metamodel interface for access to the metamodel of the persistence unit. Return: an instance of {@link Metamodel} Throws: IllegalStateException - if the entity manager factory has been closed Since: JPA 2.0

EntityManagerFactory.getCriteriaBuilder() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory CriteriaBuilder getCriteriaBuilder () Return an instance of CriteriaBuilder which may be used to construct jakarta.persistence.criteria.CriteriaQuery objects. Return: an instance of {@link CriteriaBuilder} Throws: IllegalStateException

EntityManagerFactory.addNamedQuery(name,query) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory void addNamedQuery (   String name,     Query  query ) Define the query, typed query, or stored procedure query as a named query such that future query objects can be created from it using the EntityManager

EntityManagerFactory.getPersistenceUnitUtil() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory PersistenceUnitUtil getPersistenceUnitUtil () Return interface providing access to utility methods for the persistence unit. Return: an instance of {@link PersistenceUnitUtil} Throws: IllegalStateException - if the entity manager factory has been closed Since: JPA 2.0

EntityManagerFactory.getCache() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory Cache getCache () Access the cache that is associated with the entity manager factory (the "second level cache"). Return: an instance of {@link Cache} , or null if there is no second-level cache in use Throws: IllegalStateException - if the entity manager factory has been closed Since: JPA 2.0

EntityManagerFactory.getProperties() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory Map getProperties () Get the properties and associated values that are in effect for the entity manager factory. Changing the contents of the map does not change the configuration in effect. Return: properties Throws: IllegalStateException - if the entity manager factory has been closed Since: JPA 2.0

EntityManagerFactory.createEntityManager() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory EntityManager createEntityManager () Create a new application-managed EntityManager . This method returns a new EntityManager instance each time it is invoked. The EntityManager.isOpen method will return true on the returned instance. Return

EntityManagerFactory.createEntityManager(synchronizationType,map) - JPA Method

JPA Method in javax.persistence. EntityManagerFactory EntityManager createEntityManager (    SynchronizationType  synchronizationType,    Map map ) Create a new JTA application-managed EntityManager with the specified synchronization type and map of properties

EntityManagerFactory.createEntityManager(synchronizationType) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory EntityManager createEntityManager (    SynchronizationType  synchronizationType ) Create a new JTA application-managed EntityManager with the specified synchronization type. This method returns a new EntityManager instance each

EntityManagerFactory.createEntityManager(map) - JPA Method

JPA Method in javax.persistence. EntityManagerFactory EntityManager createEntityManager (   Map map ) Create a new application-managed EntityManager with the specified Map of properties. This method returns a new EntityManager instance each time it is invoked. The isOpen method

EntityManagerFactory.getTransactionType() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory PersistenceUnitTransactionType getTransactionType () The type of transaction management used by this persistence unit, either resource-local transaction management, or JTA. Since: JPA 3.2

EntityManagerFactory.getSchemaManager() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory SchemaManager getSchemaManager () Return interface providing access to schema management operations for the persistence unit. Return: an instance of {@link SchemaManager} Throws: IllegalStateException - if the entity manager factory has been closed Since: JPA 3.2

EntityManagerFactory.runInTransaction(work) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory void runInTransaction (   Consumer  work ) Create a new application-managed EntityManager with an active transaction, and execute the given function, passing the EntityManager to the function. If the transaction type

EntityManagerFactory.getNamedEntityGraphs(entityType) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory Map getNamedEntityGraphs (   Class  entityType ) A map keyed by plain, containing every named plain whose entity type is assignable to the given Java type. Parameters: entityType - any Java type, including {@code Object.class

EntityManagerFactory.callInTransaction(work) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory R callInTransaction (   Function  work ) Create a new application-managed EntityManager with an active transaction, and call the given function, passing the EntityManager to the function. If the transaction type

EntityManagerFactory.getNamedQueries(resultType) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory Map getNamedQueries (   Class  resultType ) A map keyed by plain, containing plain to every named query whose result type is assignable to the given Java type. Parameters: resultType - any Java type, including {@code Object

EntityManagerFactory.getName() - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory String getName () The name of the persistence unit. Since: JPA 3.2

EntityManagerFactory.createEntityManager(synchronizationType,map) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory EntityManager createEntityManager (    SynchronizationType  synchronizationType,    Map  map ) Create a new JTA application-managed EntityManager with the specified synchronization type and map of properties

EntityManagerFactory.createEntityManager(map) - JPA Method

JPA Method in jakarta.persistence. EntityManagerFactory EntityManager createEntityManager (   Map  map ) Create a new application-managed EntityManager with the given Map specifying property settings. This method returns a new EntityManager instance each time it is invoked

Obtaining a JPA Database Connection

content also require an EntityTransaction instance. Obtaining an EntityManagerFactory Obtaining ... of EntityManagerFactory that represents the relevant database and then we can use that factory instance ... to be able to generate an EntityManagerFactory . But when using ObjectDB you can either define a standard

Shared (L2) Entity Cache

objects, which is managed by the EntityManagerFactory and shared by all its EntityManager objects ... ; EntityManager instances.  In addition to the EntityManager 's L1 cache and the EntityManagerFactory 's L2 ... all the EntityManagerFactory and EntityManager instances of the same database - including on different

Database Replication and Clustering

, the master database can be accessed ordinarily as follows: EntityManagerFactory emf ... =a"); A slightly different URL is required in order to access the slave database: EntityManagerFactory emf ... can also be used: EntityManagerFactory emf = Persistence.createEntityManagerFactory( "objectdb

Setting and Tuning of JPA Queries

;        For an EntityManagerFactory - using the  ... .query.timeout", 4000);    EntityManagerFactory emf =       

ObjectDB Object Database Features

competing products . Connection Pooling Automatic connection pool managed by EntityManagerFactory ... (per EntityManager). L2 shared entity data cache  (per EntityManagerFactory ). Database file page cache

JPA Persistence Unit

to instantiate an EntityManagerFactory in JPA (as explained in the JPA Overview section) requires ... ” in the example) identifies the persistence unit when instantiating an EntityManagerFactory

Locking in JPA

;property:             For an EntityManagerFactory ... ; properties.put("javax.persistence.lock.timeout", 2000);    EntityManagerFactory emf =  

JPA Queries

the EntityManagerFactory 's getCriteriaBuilder method or by the  EntityManager 's

Control and Setting

This section contains miscellaneous JPA types. The PersistenceUtil and PersistenceUnitUtil interfaces provide general utility methods: The Cache interface and the CacheRetrieveMode and CacheStoreMode enum types serve in managing the EntityManagerFactory's shared (level 2) cache: Other enum types are provided for setting of various JPA operations:

JPA Metamodel API

Metamodel API is Metamodel . It can be obtained either by the EntityManagerFactory 's getMetamodel

Entity Management Settings

that is managed by the EntityManagerFactory and shared by all its EntityManager instances. The level 2 cache

Posting Sample Code

; EntityManagerFactory emf =             Persistence

JPA Criteria API Queries

the EntityManagerFactory 's getCriteriaBuilder method or by the  EntityManager 's getCriteriaBuilder method

Working with JPA Entity Objects

also manages a level 2 shared cache for the EntityManagerFactory as well as other caches as explained in

JPA Primary Key

(project); A PersistenceUnitUtil instance is obtained from the EntityManagerFactory . The 

SSL Configuration

of the standard "objectdb" protocol) in the connection URL on the client side: EntityManagerFactory emf

Step 3: Add a Context Listener Class

a JPA's EntityManagerFactory instance with a global application scope. We have to register ... created if not existing yet) when the web application starts, by instantiating an EntityManagerFactory ... closing the EntityManagerFactory . To register a ServletContextListener : Open the [New Listener

Step 3: Add a Context Listener Class

a JPA's EntityManagerFactory instance with a global application scope. We have to register ... an EntityManagerFactory . The database will be closed when the web application stops (or when the web server shuts down), by closing the  EntityManagerFactory . To register a ServletContextListener : Open the [New

Step 4: Add a Servlet Class

, IOException { // Obtain a database connection: EntityManagerFactory emf = ( EntityManagerFactory ... ); } } GuestServlet performs the following operations on every http request: The EntityManagerFactory

Step 4: Add a Servlet Class

: EntityManagerFactory emf = ( EntityManagerFactory )getServletContext().getAttribute("emf"); EntityManager em ... on every http request: The EntityManagerFactory is retrieved from the application scope attribute

Step 3: Add a Main Class

yet): EntityManagerFactory emf = Persistence.createEntityManagerFactory(       

Step 3: Add a Main Class

a database connection // (create a new database if it doesn't exist yet): EntityManagerFactory emf

Step 2: Define a JPA Entity Class

a context listener class that will manage a JPA's EntityManagerFactory representing the ObjectDB database.

Step 2: Define a JPA Entity Class

listener class that will manage a JPA's EntityManagerFactory representing the ObjectDB database.