persistence.xml ignores Hibernate and chooses DataNucleus
- by iNPUTmice
Hi,
I'm toying around with GWT (dunno if this matters) and Hibernate. I've created a a file persistence.xml in META-INF with (amoung) other configuration the line:
org.hibernate.ejb.HibernatePersistence
But when I startup the EntityManager it chooses DataNucleus instead of Hibernate (which later fails because it isnt installed (jar are not in the class path))
Java Code is:
EntityManagerFactory factory = Persistence.createEntityManagerFactory("gwt");
EntityManager em =factory.createEntityManager();
EntityTransaction transacation = em.getTransaction();
transacation.begin();
Campaign campaign = new Campaign();
campaign.setName("Test");
em.persist(campaign);
transacation.commit();
config file contains:
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="gwt" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
...