Using Eclipse’s Dali to make a jpa(pojo) module with Maven M2 Plugin
(First install M2 Plugin if you have not..I was using Eclipse Ganymede, so Dali was already in, but M2 was not)
1) Created a mvn submodule(to a parent) using maven(m2) plugin
2) Archetype selected was archetype with group-id=com.rfc.maven.archetypes and artifact-id=jpa-maven-archetype
3) Then right-clicked on the submodule project and selected JPA Tools–> convert to JPA Project…
4) In the JPA facet selected Generic, then my db and schema and used openjpa(installed it locally and browsed to it) as the implementation library. Made sure that persistence.xml did not include class names(gives you an error “This mapped class is not specified in persistence unit..” otherwise..No clue why..but thinking it is because there were two persitence.xml files; one from the archetype in src/main/resources/META-INF and the other when using the Dali tool with a persistence.xml under “JPA Content”)
5) After converting to JPA project, right click on submodule project and select JPA Tools—>Generate Entities. This takes me to a screen that would allow me to select all my normalized perfectly designed db tables (synchronizing with persistence.xml was not checked). Once I said ok on that screen, code for entities were generated with no errors..Voila!
==================
Update on Feb 14th 2009: You could skip step 2 and use the Quickstart archetype instead of the jpa archetype and then do the rest of the steps too. Step 2 is a waste if you are using eclipse to convert a project to a JPA project.