tell me more icon Creating Persistence Units

In the previous cue card, when you used the Create Entities from Tables wizard to create the JPA entity, JDeveloper automatically created a default persistence unit Project1 in the persistence.xml file. That default persistence unit is configured to run inside a Java EE container.

Overview editor for the persistence.xml file

In this example, you will create a persistence unit that runs outside of a container for the same entity.

Create Persistence Unit page of the wizard

The same entity can appear in multiple persistence units, but hold different mapping behavior in each one. In addition to defining the entity classes that it represents, a persistence unit also defines its data source information (when overriding the default connection) and any of a number of platform-specific properties. A common need for creating separate persistence units is to run the same entity or entities both inside and outside the Java EE container.

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,