In JBoss, datasources are defined in files named "xxxxx-datasource.xml". JBoss digests them, creates the datasource/connection pool objects, and files them in the JNDI directory so that apps can reference them.
For JPA EJB entities JBoss will inject the entity manager into the appropriately-designated places, and at that point, I'll have to leave you to the tender mercies of the JBoss docs, since the last time I worked with it, I was trying to get a non-EJB JPA app installed and I ended up falling back to just basic
Tomcat after wearing myself out on JSF portability issues.
There are still Entity Beans in EJB3/JPA, Mark. I think you might have been referring to BMP beans, but I'd have to RFTM on that one, since while JPA makes self-managing entity beans rather silly, BMP still may be supported as a remotable data access mechanism.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.