code: public Attribute getEntityAttribute(Class clazz, String fieldName)
      {
          if (entityTypes != null && entityTypes.containsKey(clazz))
          {
              EntityType entityType = entityTypes.get(clazz);
              return entityType.getAttribute(fieldName);
          }
          throw new IllegalArgumentException("No entity found: " + clazz);
      }
docs: Returns entity attribute for given managed entity class.
  
  @param clazz
  Entity class
  @param fieldName
  field name
  @return entity attribute