I've tried to include DataNucleus into the Spring Data JPA integration test suite together and tried quite a few approaches to get the enhancement working for the second time, and failed again:
- using the Maven plugin but there doesn't seem to be a way to enhance test classes (I googled but there neither seem to exist an enhance-test-classes goal nor an ability to set the source folder to pick up classes from). Is there any documentation on how to set up enhanceing for classes from src/test/java?
- runtime enhancement using a load time weaver. I followed http://www.datanucleus.org/products/accessplatform/enhancer.html#runtime
. There's no enhancer in current datanucleus-core jars (I used 3.1.4). So I tried datanucleus-enhancer jar (which I found references to on other google results) which is even more related to JDO, so I guess that was a wrong path as well. I then went with addClassTransformer and a Spring load time weaver but that left my entites unenhanced.
All in all I couldn't find any place in the reference docs that contained a working example of how to set up JPA enhancement that works. The fact, that there exists such documentation made me scratching my head even more facing all the JDO related exceptions as I wasn't expecting to see them as I wanted to setup JPA.
Finally I found a repo containing a complete example https://github.com/matthewadams/spring-dta-jpa-datanucleus-mongodb
. That uses the maven plugin (which I'd like to avoid as I need run test cases against other JPA providers as well and wat to avoid the enhancing of DataNucleus to interfere with these executions) but also only enhances src/main/java classes.
Is there some up-to-date documentation for the JPA setup I have missed?