Introducing the persistence.xml file
The persistence.xml
file is generated during the reverse engineering process and defines the JPA configuration for a set of entity classes. This file is always located in the META-INF
directory at the root of the classpath. Maven projects have a special directory named resources
located in the src/main
directory, which contains additional resources applicable for building the Java project. The resources
directory is automatically copied by Maven to the root of the classpath when building the project. Open the file by double-clicking on it to display the Design view of the file in the editor:
The Design view contains several properties that are used to configure the persistence unit behavior. We will stick to the simplest settings, but we encourage you to explore the different strategies that may be useful for your own application's needs. For example, projects that require tables to be automatically created will appreciate the Table Generation Strategy...