Annotation Interface PersistenceUnit


@Target({TYPE,FIELD,METHOD,PARAMETER,PACKAGE}) @Retention(RUNTIME) @Documented @Qualifier @Repeatable(List.class) public @interface PersistenceUnit
This annotation has two different purposes. It is a qualifier used to specify to which persistence unit the injected EntityManagerFactory or EntityManager belongs.

This allows for regular CDI bean injection of both interfaces.

It is also used to mark packages as part of a given persistence unit.