I'm trying to learn JPA and I want create a simple Java command line app that will use JPA to query and update a database table. I mapped out the the simple code needed to do this. But I don't know how to configure the directory structure, where to place the persistence.xml file, packaging and so on. This is just a quick and dirty learning exercise so I want to keep this as simple as possible. Can someone spell out the steps in order to do this?
I'm using Weblogic 10.3.
persistence.xml goes in the META-INF
directory that is at the same level as your persistence classes. Here's an example of some valid and invalid configurations. In the non-Java EE apps I've written, I build the JAR with persistence.xml in WEB-INF/classes/META-INF/
, because my JPA classes are in WEB-INF/classes/
.