Do not use subclass of EntityManager or EntityManagerFactory for injected JPA elements

When injecting a PersistenceContext or PersistenceUnit, use EntityManager or EntityManagerFactory objects, and do not use subclasses. This rule detects the presence of injected subclasses of EntityManager or EntityManagerFactory.

The following conditions will trigger the rule:

The source scanner quick fix replaces those subclasses with EntityManager or EntityManagerFactory classes.

Examples: