private MappedClassInfo getMappedClassInfoForNonAliasedToken(
      CompletionParser cp, boolean matchNameExact) {
    MappedClassInfo ret = null;

    for (MappedClassInfo mappedClassInfo : _mappedClassInfos) {
      if (mappedClassInfo.matches(cp, true, true)) {
        // An exact match always ends search
        return mappedClassInfo;
      } else if (false == matchNameExact && mappedClassInfo.matches(cp, false, true)) {
        // We have a non exact match here.
        // Nonetheless we continue the loop to see if an exact match exists
        ret = mappedClassInfo;
      }

      if (cp.getStringToParse().startsWith(mappedClassInfo.getClassName())
          || cp.getStringToParse().startsWith(mappedClassInfo.getSimpleClassName())) {
        ArrayList<PropertyInfo> matchingAttributes =
            mappedClassInfo.getQualifiedMatchingAttributes(cp);
        for (PropertyInfo matchingAttribute : matchingAttributes) {
          if (matchingAttribute
              .getHibernatePropertyInfo()
              .getPropertyName()
              .equals(cp.getLastToken())) {
            return matchingAttribute.getMappedClassInfo();
          }
        }
      }
    }

    return ret;
  }