Top Description Methods
jakarta.persistence

public @Interface PersistenceUnit

extends Annotation
Annotations
@Repeatable:PersistenceUnits
@Target:TYPE, METHOD, FIELD
@Retention:RUNTIME
Imports
java.lang.annotation.Repeatable, .Target, .Retention

Expresses a dependency on an EntityManagerFactory and its associated persistence unit.
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public String
name()

(Optional) The name by which the entity manager factory is to be accessed in the environment referencing context; not needed when dependency injection is used.

public String
unitName()

(Optional) The name of the persistence unit as defined in the persistence.xml file.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

nameback to summary
public String name()

(Optional) The name by which the entity manager factory is to be accessed in the environment referencing context; not needed when dependency injection is used.

unitNameback to summary
public String unitName()

(Optional) The name of the persistence unit as defined in the persistence.xml file. If specified, the persistence unit for the entity manager factory that is accessible in JNDI must have the same name.