openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Is it possible to override the default openjpa persistence provider
Date Thu, 02 May 2013 06:50:25 GMT
> The reason is I want to override the EntityManager.

OpenJPA provides its JPA API (such as EntityManagerFactory or EntityManager
etc.) as a facade to its kernel which is general-purpose object management
facility agnostic to JPA. Similarly the kernel talks to a datastore via a
StoreManager API which is agnostic to relational database or JDBC. 
So if you want specific functional behavior, you should consider
implementing Brokerfactory and Broker interfaces that are OpenJPA equivalent
of  EntityManagerFactory and EntityManager respectively. These two
interfaces are implemented as JDBCBrokerfactory and BrokerImpl.

The examples of such extensions are available in OpenJPA source codebase.
See openjpa-slice module (especially DistributedBrokerfactory and
DistributedBrokerImpl) where similar extension works with multiple

Pinaki Poddar
Chair, Apache OpenJPA Project
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message