I am new to JPA and use Hibernate as the JPA provider. I came to know that we need
<persistence-unit name="test-jpa" transaction-type="RESOURCE_LOCAL">
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/~/test"/>
<property name="hibernate.connection.username" value="sa" />
<property name="hibernate.connection.password" value="" />
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("test-jpa");
JPA provider would provide documentation that would tell you all of that. Doesn't yours? I'd be surprised.
You should either have a
<provider> element in the persistence-unit to define which provider to use, or it would use the default for the environment that you are running in (in
JavaSE you would need to have 1 and only one
JPA provider in the CLASSPATH, in
JavaEE the server would have its own default).
They are provider-specific. Any properties that are prefixed
javax.persistence would be
JPA STANDARD. The first 4 of those posted have
javax.persistence variants that you should have used instead.