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:

An automatic fix will replace those subclasses with EntityManager or EntityManagerFactory classes.

Examples: