openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Martelli <>
Subject Re: Configuration extension
Date Tue, 28 Aug 2012 11:17:00 GMT

Il giorno 27/ago/2012, alle ore 18.44, Kevin Sutter ha scritto:

> Hi Fabio,
> Unfortunately, OpenJPA doesn't have great documentation for extending the
> configuration.  Although, in practice, it is quite easy to do.  What I
> would suggest doing is "implement by example" and look at how other
> configuration properties were incorporated.  For example, let's just take
> openjpa.datacache as an example.  All of the configuration properties use a
> "plugin configuration" [1].  Then, if you look at the
> OpenJPAConfigurationImpl class, you'll see how this openjpa.datacache is
> parsed and configured.  From there, these configuration values are used
> through out the code (grep for "dataCachePlugin" as an example).
> Hope this helps get you started.

Hi Kevin, thank you for your prompt replay.
I sow that OpenJPA configuration is not pluggable.
It seems that, the only way to replace the configuration impl (in order to add new parameters)
it to specify a new BrokerFactory (maybe extending JDBCBrokerFactory) overriding the single
static method newInstance(...).

Please, let me know what you think about this solution.

Thank you in advance.
Best regards,

> Kevin
> [1]
> On Fri, Aug 24, 2012 at 10:32 AM, Fabio Martelli
> <>wrote:
>> Hi All,
>> I'd like to extend OpenJPA configuration in order to add some custom
>> parameters into my persistence.xml.
>> Could you give me the best practice to do this?
>> Thank you in advance.
>> Best regards,
>> F.

View raw message