Maven2 Spring & OpenJPA
I recently found myself having to do some plain old Java code, implementing some EJB3 code. It's been a while, I've been working mainly with Spring/Hibernate/Ibatis on the Java side and was hoping I wouldn't have to touch fully blown J2EE again.
I found a rather nice sample application written by David Krisch of how to do JPA using Spring, Maven and Hibernate - you can find it here: http://code.google.com/p/mvn2-spring-jpa. The sample uses native JPA DAOs so there is no dependency on on Spring in the DAOs - nice.
Anyway - my implementation uses OpenJPA, not Hibernate - so I wanted to convert this sample to work with OpenJPA. It was surprisingly simple, and to my surprise there is less config than the Hibernate version. You don't need to call hbm2ddl to create the datebase, you can just use the nice little openjpa property openjpa.jdbc.SynchronizeMappings in your persistence.xml.
My new sample is here http://github.com/spidie/mvn2-spring-openjpa (slight name change so not to confuse it with David's) I hope this of use to someone out there - I've found real samples of this kind of thing quite hard to find.
One little gotcha with the hibernate version - if you are not on Java 1.6 you have to explicitly drag in the the common-anotations library as this isn't include in J2SE 5 - I think David might have updated this by now.
Whilst writing this I just noticed that the code doesn't correctly translate persistent exceptions - so I'll go and fix that up now!

Comments
Thanks!
Just was I was looking for!