destinationEntity = relationship != null ? relationship.entity() : null;
destinationEntity = relationship != null ? relationship.destinationEntity() : null;
    public String destinationEntityName() {        if(_destinationEntityName == null) {            _destinationEntityName = (String)valueForBinding("destinationEntityName");            if(_destinationEntityName == null) {                Object _source = sourceObject();                EOEditingContext ec = editingContext();                EOEntity destinationEntity = null;                                if(_source instanceof EOEnterpriseObject) {                    EOEnterpriseObject eo = ((EOEnterpriseObject)_source);                    EORelationship relationship = ERXUtilities.relationshipWithObjectAndKeyPath((EOEnterpriseObject)_source, relationshipKey());                    destinationEntity = relationship != null ? relationship.entity() : null;                } else {                    String anEntityName = sourceEntityName();                    if(anEntityName != null) {                        EOEntity anEntity = ERXEOAccessUtilities.entityNamed(ec, anEntityName);                        if (anEntity == null) {                            throw new IllegalStateException("<" + getClass().getName() + " could not find entity named " + anEntityName + ">");                        }                        destinationEntity = ERXEOAccessUtilities.destinationEntityForKeyPath(anEntity, relationshipKey());                    } else {                        destinationEntity = ERXEOAccessUtilities.entityNamed(ec, anEntityName);                    }                }                if(destinationEntity == null) {                    throw new IllegalStateException("Destination entity could not be retrieved from EO of bindings. Either set the \"sourceObject\" to an EO, provide the \"sourceEntityName\" and \"relationshipKey\", the \"destinationEntityName\" or the \"list\" binding.");                }                                _destinationEntityName = destinationEntity.name();            }        }        return _destinationEntityName;    }