Mostrando entradas con la etiqueta persistence.xml persistence entities. Mostrar todas las entradas
Mostrando entradas con la etiqueta persistence.xml persistence entities. Mostrar todas las entradas

20 abril 2009

persistence unit

Packaging

EJB3 JPA is standardizing POJO persistence. Thus, entities aren't limited to EJB modules; they can be packaged in a Web module, ejb-jar module, library module in the EAR level, or a standard jar file. You can also use entities in Java SE. You must package a descriptor (persistence.xml), like the following, in the archive that contain entities:



oracle.toplink.essentials.PersistenceProvider
jdbc/OracleDS
...

This descriptor identifies the persistence provider, persistent units, and the data source used by a persistent unit. As the name suggests, a persistent unit is a collection of entities that are managed together. If you have a single persistent unit defined in a specific module, you don't have to identify the entity classes in the persistence.xml; it will be dynamically discovered by the persistence provider.