See the topics, Developing JPA applications for a Java EE environment and Developing JPA applications for a Java SE environment.