Does anyone know how to create your own JPA provider? I was considering making a custom JPA provider that could interface with a SOAP webservice we use. However, I can't seem to find any document describing how to create your own JPA provider. Where should I start looking?
You start by implementing javax.persistence.spi.PersistenceProvider
interface and specifying your implementation using provider
element within persistence unit declaration:
<persistence-unit name="myUnit">
<provider>com.mypackage.CustomPersistenceProvider</provider>
...
</persistence-unit>
That gives you an entry point for creating your own EntityManagerFactory
and, consequently, EntityManager.
The $64,000 question here, though, is why you would want to do something like this? If this is related to your Lazy Hibernate JPA using SOAP question then this is probably not the right approach to take.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With