I've been experimenting with extending the OpenJPA implementation. My first experiment was just extending the OpenJPA PersistenceProviderImpl class and selectively enhancing a couple of methods. At first, this looked to be rather straight forward. But, then I ran into a problem with the ConfigurationProviderImpl load() method since it did some validation to make sure that a requested PersistenceProvider element was equal to the currently executing class:
if (!StringUtils.isEmpty(providerName) && !PersistenceProviderImpl.class.getName().equals(providerName)) return false; Since I have extended the PersistenceProviderImpl class, this test failed. I considered modifying the above conditional to be more lenient of openjpa-derived persistence providers, but Patrick pointed out (via a separate e-mail) that we might end up with some false positives when a specific persistence provider is requested. Thus, we decided to move this conversation to the dev mailing list to get a discussion started.
From what I can tell, we have the PersistenceProviderImpl, the
ConfigurationProvider Service, and the ProductDerivation Service that can help develop a proper OpenJPA derivative. Even my brief experimentation with extending the PersistenceProviderImpl showed that this would not be useful without extending the ConfigurationProviderImpl (or providing a replacement implementation). So, is there a defined mechanism and process for extending the OpenJPA persistence provider? If not, any good starting points? I'm happy to do the experimentation. I just would like to fit within the defined framework. Thanks, Kevin