ObjectDB Database Search

1-50 of 200 results

jakarta.persistence.EntityManagerFactory

Jakarta Persistence (JPA) Interface jakarta.persistence. EntityManagerFactory Super Interfaces ... . An EntityManagerFactory with a lifecycle managed by the application may be created using the static operations ... , there is exactly one EntityManagerFactory for each persistence unit: // create a factory at initialization time

jakarta.persistence.EntityManagerFactory.unwrap(Class)

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory T unwrap (   ... . If the provider implementation of EntityManagerFactory does not support the given type ... either the underlying class implementing EntityManagerFactory or an interface it implements. Returns

jakarta.persistence.EntityManagerFactory.close()

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory void close() Close ... , all methods invoked on it will throw the IllegalStateException , except for EntityManagerFactory .isOpen , which will return false. Once an EntityManagerFactory has been closed, all its entity managers

jakarta.persistence.EntityManagerFactory.addNamedEntityGraph(String,EntityGraph)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.getNamedQueries(Class)

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory Map getNamedQueries (    Class resultType ) Type Parameters: - the specified upper bound on the query result types A map keyed by query name , containing references to every named query whose result type

jakarta.persistence.EntityManagerFactory.getNamedEntityGraphs(Class)

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory Map getNamedEntityGraphs (    Class entityType ) Type Parameters: - the specified upper bound on the entity graph types A map keyed by graph name , containing every named entity graph whose entity type

jakarta.persistence.EntityManagerFactory.runInTransaction(Consumer)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.getTransactionType()

Jakarta Persistence (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: Jakarta Persistence (JPA) 3.2

jakarta.persistence.EntityManagerFactory.getSchemaManager()

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory SchemaManager getSchemaManager() Return interface providing access to schema management operations for the persistence unit. Returns: an instance of SchemaManager . Throws: IllegalStateException - if the entity manager

jakarta.persistence.EntityManagerFactory.addNamedQuery(String,Query)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.callInTransaction(Function)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.createEntityManager()

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.createEntityManager(Map)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.createEntityManager(SynchronizationType)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.createEntityManager(SynchronizationType,Map)

Jakarta Persistence (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

jakarta.persistence.EntityManagerFactory.getName()

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

jakarta.persistence.EntityManagerFactory.getProperties()

Jakarta Persistence (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. Returns: properties. Throws

jakarta.persistence.EntityManagerFactory.getCache()

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory Cache getCache() Access the cache that is associated with the entity manager factory (the "second level cache"). Returns: an instance of Cache , or null if there is no second-level cache in use. Throws

jakarta.persistence.EntityManagerFactory.getPersistenceUnitUtil()

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory PersistenceUnitUtil getPersistenceUnitUtil() Return interface providing access to utility methods for the persistence unit. Returns: an instance of PersistenceUnitUtil . Throws: IllegalStateException - if the entity

jakarta.persistence.EntityManagerFactory.getCriteriaBuilder()

Jakarta Persistence (JPA) Method in jakarta.persistence. EntityManagerFactory CriteriaBuilder getCriteriaBuilder() Return an instance of CriteriaBuilder which may be used to construct CriteriaQuery objects. Returns: an instance of CriteriaBuilder . Throws: IllegalStateException - if the entity

jakarta.persistence.EntityManagerFactory.getMetamodel()

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

jakarta.persistence.EntityManagerFactory.isOpen()

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

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

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

jakarta.persistence.EntityManager

must be obtained from an EntityManagerFactory , and is only able to manage persistence of entities belonging ... via a call to EntityManagerFactory .createEntityManager . The EntityManager must be explicitly closed ... , and is thus considered quite error-prone. It is much safer to use the methods EntityManagerFactory .runInTransaction

jakarta.persistence.Persistence

.persistence.Persistence Bootstrap class used to obtain an EntityManagerFactory in Java SE environments ... EntityManagerFactory createEntityManagerFactory ( String persistenceUnitName ) Create and return an EntityManagerFactory for the named persistence unit. Parameters: persistenceUnitName - the name

jakarta.persistence.PersistenceConfiguration

, allowing programmatic creation of an EntityManagerFactory . The configuration options available ... . If injection of the EntityManagerFactory is required, a CDI Producer may be used to make the EntityManagerFactory available as a CDI managed bean. @Produces @ApplicationScoped @Documents

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.