Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a JPA Provider

Tags:

java

jpa

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?

like image 778
User1 Avatar asked Aug 29 '09 04:08

User1


1 Answers

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.

like image 86
ChssPly76 Avatar answered Oct 05 '22 09:10

ChssPly76