OpenJPA ambiguous Index reference

This rule detects Java code that includes a non-qualified reference to the org.apache.openjpa.persistence.jdbc.Index class when there are on-demand imports for both the org.apache.openjpa.persistence.jdbc and javax.persistence packages. The Java Persistence API (JPA) 2.1 specification introduced a new javax.persistence.Index class. This causes the following compilation error when you compile against both the OpenJPA and Java EE 7 JPA 2.1 libraries:

The type Index is ambiguous

If you want to use the OpenJPA 2.0 implementation and encounter this error, verify you are compiling against the JPA 2.0 libraries rather than the JPA 2.1 libraries. For Liberty, compile against the JPA 2.0 specification JAR (com.ibm.ws.javaee.persistence.2.0.*.jar) found in the wlp/dev/api/spec directory. For traditional WebSphere, use fully qualified imports or fully qualified class references to avoid ambiguities.