IEOAttribute targetAttribute = null; if (_keyPath != null && _keyPath.length() > 0) { int dotIndex = _keyPath.indexOf('.'); if (dotIndex == -1) { targetAttribute = getAttributeOrRelationshipNamed(_keyPath); } else { EORelationship relationship = getRelationshipNamed(_keyPath.substring(0, dotIndex)); EOEntity destination = relationship.getDestination(); if (destination != null) { targetAttribute = destination.resolveKeyPath(_keyPath.substring(dotIndex + 1)); } } }
IEOAttribute targetAttribute = resolveKeyPath(_keyPath, new HashSet());
  public IEOAttribute resolveKeyPath(String _keyPath) {    IEOAttribute targetAttribute = null;    if (_keyPath != null && _keyPath.length() > 0) {      int dotIndex = _keyPath.indexOf('.');      if (dotIndex == -1) {        targetAttribute = getAttributeOrRelationshipNamed(_keyPath);      }      else {        EORelationship relationship = getRelationshipNamed(_keyPath.substring(0, dotIndex));        EOEntity destination = relationship.getDestination();        if (destination != null) {          targetAttribute = destination.resolveKeyPath(_keyPath.substring(dotIndex + 1));        }      }    }    return targetAttribute;  }