/**
  * Get {@link javax.persistence.AccessType } from {@link javax.persistence.Access @Access} on the
  * attribute of the given class
  */
 static XMLAccessType getAccessFromAttributeAnnotation(
     DotName className, String attributeName, IndexBuilder indexBuilder) {
   Map<DotName, List<AnnotationInstance>> indexedAnnotations =
       indexBuilder.getIndexedAnnotations(className);
   if (indexedAnnotations != null && indexedAnnotations.containsKey(ACCESS)) {
     List<AnnotationInstance> annotationInstances = indexedAnnotations.get(ACCESS);
     if (MockHelper.isNotEmpty(annotationInstances)) {
       for (AnnotationInstance annotationInstance : annotationInstances) {
         AnnotationTarget indexedPropertyTarget = annotationInstance.target();
         if (indexedPropertyTarget == null) {
           continue;
         }
         if (JandexHelper.getPropertyName(indexedPropertyTarget).equals(attributeName)) {
           XMLAccessType accessType =
               JandexHelper.getValueAsEnum(annotationInstance, "value", XMLAccessType.class);
           /** here we ignore @Access(FIELD) on property (getter) and @Access(PROPERTY) on field */
           XMLAccessType targetAccessType = annotationTargetToAccessType(indexedPropertyTarget);
           if (accessType.equals(targetAccessType)) {
             return targetAccessType;
           } else {
             LOG.warn(
                 String.format(
                     "%s.%s has @Access on %s, but it tries to assign the access type to %s, this is not allowed by JPA spec, and will be ignored.",
                     className, attributeName, targetAccessType, accessType));
           }
         }
       }
     }
   }
   return null;
 }
 private static XMLAccessType processIdAnnotations(List<AnnotationInstance> idAnnotations) {
   XMLAccessType accessType = null;
   for (AnnotationInstance annotation : idAnnotations) {
     AnnotationTarget tmpTarget = annotation.target();
     if (tmpTarget == null) {
       throw new AssertionFailure("@Id has no AnnotationTarget, this is mostly a internal error.");
     }
     if (accessType == null) {
       accessType = annotationTargetToAccessType(tmpTarget);
     } else {
       if (!accessType.equals(annotationTargetToAccessType(tmpTarget))) {
         throw new MappingException("Inconsistent placement of @Id annotation within hierarchy ");
       }
     }
   }
   return accessType;
 }