Hi Fabio, It all depends on how extensible of a solution you are looking for. Are you looking to just extend a current OpenJPA implementation and then migrating those necessary changes from release to release (as your needs required)? Or, are you looking to provide a pluggable configuration which would make it easier to grow with the OpenJPA releases (but requires a bit more work up-front)? That's part of the analysis of the requirements that you'll have to do.
As you have probably noticed, OpenJPA itself has already extended the OpenJPAConfigurationImpl with both the JDBCConfigurationImpl and the XMLConfigurationImpl. (As an aside, WebSphere has also extended this implementation for their own extensions.) So, the capability is there. It's just a matter of how much effort you want to put into it. Good luck, Kevin On Tue, Aug 28, 2012 at 6:17 AM, Fabio Martelli <[email protected]>wrote: > > 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, > F. > > > Kevin > > > > [1] > > > http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_conf_plugins > > > > On Fri, Aug 24, 2012 at 10:32 AM, Fabio Martelli > > <[email protected]>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. > >
