Skip to content

Use Named or Qualifier to replace the existing PersistenceContext/PersistenceUnit #456

Closed
@hantsy

Description

@hantsy

When switching to CDI first, #377, I would like deprecate the existing PersistenceContext/PersistenceUnit uses @Named or @Qualifier with @Inject instead.

@Inject @Named("customerDatabase")  EntityManager em;
@Inject @CustomerDatabase  EntityManager em;

@Inject @CustomerDatabase  EntityManagerFactory emf;

@Qualifier is preferred, declaring an EMF with the same qualifiers, see #358

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions