posted 15 years ago
I don't use IDE wizards for stuff like this. I manipulate the project files directly, so whatever advice I can give won't reflect MyEclipse (which I don't have installed), and won't even have a whole lot to do with Eclipse itself. But it will be JEE, which is what the ultimate goal is, IDE or not.
JPA is part of the EJB3 spec, so what you're really saying is that you want to get EJB3 running. You can run JPA without the full EJB3 (for example Spring/Hibernate/Tomcat), but EJB3 is JPA. EJB2 and earlier are not.
When the container supports EJB3, you can have it inject the persistence manager into your Session EJBs using JPA annotations. Most of the JNDI stuff goes undercover or disappears entirely in EJB3. Remoting was the norm under the original EJB spec, and you needed JNDI for that, but Remote beans are the exception in EJB3, so direct object references are usually sufficient.
In cases where you don't have the server providing direct EJB support, the persistence.xml file is normally where you configure your connection/entitymanagerfactory persistence information. I've spent so much time in places where they banned EJBs that I'm not quite sure what, if any role the persistence.xml performs in a true EJB container, although with luck I'll know more later this week when I attempt to port a project.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer