Dimitrij Drus
Dimitrij Drus
test data models are project specific now
Hi @ArneLimburg. Excuse me please for the belated answer. To be honest, I wonder about the purpose. I mean, it looks like you're trying to reuse your __production__ `persistence.xml` file...
I guess, those who've written the JPA specification have not though about config update at runtime. It is however another story :) Do you have a stack trace for me...
What happens if you update the constructor of `PersistenceUnitDescriptorImpl` like following? ```java public PersistenceUnitDescriptorImpl(final Element element, final Map properties) { this.properties = new HashMap(properties); classList = new ArrayList(); parse(element); //...
You're right. the call to `Persistence.createEntityManagerFactory` will load the `persistence.xml` once again. Less invasive is better :) ```java // cannot use JTA if (properties.containsKey("javax.persistence.jtaDataSource")) { this.properties.put("javax.persistence.jtaDataSource", null); } ``` I...
I'll try to take a closer look at it in the next few days. It looks like the `@Before*` methods are not properly handled.
which JPA provider and which DB are you using? I just did a copy&paste of your code above and with JPA 2.1 hibernate implementation with h2 I receive a "1"...
One additional thing: The transaction "closure" encloses the entire test, including the setup (`@BeforeEach` in JUnit5 and `@Before` in JUnit4) and tear down steps (`@AfterEach` in JUnit5 and `@After` in...
You can also use the `TransactionSupport` class and do something like ``` Test t1 = new Test(); t1.setName("Test1"); newTransaction(manager).execute(() -> { entityManager.persist(t1); }); ``` in your `setup` method. It will...